I've never rented a car in Europe, but I've always--even before retirement--been able to take trips longer than two weeks, so I haven't felt terribly constrained. However, a car can be very handy when you want to see small villages or when you are traveling to places rather infrequently served like Ronda. A lot of folks like to rent a car to travel between Seville and Granada (a trip with very fast train service which, however, involves a geographically circuitous route), allowing them to stop in such places as Ronda, Arcos de la Frontera, Zahara and Grazalema. In your case, you might use a car between Malaga and Granada.
There's extraordinarily fast train service from Barcelona to Madrid, Cordoba and Seville; from Barcelona to Madrid, Cordoba and Malaga; and good (but not frequent) service from Cordoba to Granada. (As you can see, you're likely to pass through Cordoba more than once.) The trains from Seville south to Cadiz are fine but not super-fast expresses.
There's no direct rail link between Cadiz and Malaga, so a bus will probably be best for that leg of your trip. Spanish intercity buses are generally very comfortable. They are well worth considering any time the train route deviates sharply from a straight line or when train service is limited and none of the departures fit your schedule (which might happen into or out of Granada).
It's easier to get to Ronda from the west (Seville) than from the east, I think, unless you have a car. Links to Malaga may be quite good; I just never thought of traveling that way.
Side trips I enjoyed via bus include:
Seville to Carmona
Seville to Arcos de la Frontera (not a short trip; bus service is better from Jerez).
Ronda to Grazalema
Cadiz to Vejer de la Frontera (another white town)
Granada to Priego de Cordoba
You do have to be patient when dealing with public buses. I usually retain some flexibility by fiddling with lunch, choosing to skip it (or buy a banana, etc.) if I'm almost through seeing a small town and there's a bus departure coming up, followed by a really long gap before the next bus. If I have a 2- or 3-hour wait for the next bus, I will treat myself to a sit-down lunch.