I'm unclear on your departure airport for the trip back home--is it Lisbon? If so, I wouldn't want four destinationa as separated as you have suggested--Lisbon, Algarve, Seville, Madrid or Barcelona. You'd need to return to Lisbon from either Madrid or Barcelona, creating another long travel leg. Every day when you shift your hotel base, you lose at least half a day, and it is frequently longer than that. How long is your trip, actually? How many nights can you spend in Europe, not counting the overnight flight? If you have only eleven nights in Europe, that's just ten full, non-jetlagged days. If you spend four of those moving on to the Algarve, then Seville, then Madrid or Barcelona, then back to Lisbon, you end up with just six days when you can fully relax and sightsee where you are without spending a large chunk of the day finding the train station, bus station or airport and dealing with the hotel check-out/check-in process.
To supplement the information Bill has already provided:
Unfortunately, despite what geography may suggest, Portugal and Spain do not combine well, especially on a short trip. There are very limited ways to cross the border without hopping on a plane. There are buses across the border in the south, as Bill said. There used to be a night train between Lisbon and Madrid, but that hasn't run for quite some time. Shockingly, there is no day train on that route (that I can find).
The Portuguese company Rede Expressos and the Spanish company ALSA seem to have some sort of cooperative agreement to run one daytime bus and one nighttime bus between the two capitals. It takes at least eight hours. Go to the ALSA website for the schedule.
You can cross the border in the north as you travel from Porto to Santiago de Compostela.
That's it unless you fly or rent a car. If you rent a car, you pretty much have to return it to the same country where you rented it; otherwise, there will be a high international drop charge--probably hundreds of euros.
I like Portugal, but the Algarve wasn't all that special to me. During the holiday season, the best combination of weather and sightseeing will be in southern Spain. Barcelona should also be fairly mild; it averages about 10 degrees warmer than Madrid at that time of year. You can definitely fly from Seville to Barcelona, but there are a few super-fast direct trains on that route that take barely over 5-1/2 hours. Others mostly take 6-1/2 hours or more and require a change in Madrid.
During the holiday season both flights and trains could be quite pricey, but the fastest route by car would be over 10 hours without allowing for any stops, getting lost, traffic back-ups, looking for parking or dealing with the rental agency. Normally, we'd all recommend that you buy the desired tickets (train or air) early before they reach peak prices, but the cheap tickets will be nonrefundable, and the COVID situation does make such early purchases riskier than they were prior to 2020.