Cardiff city centre is around 12 miles away, and by road that usually means 25 to 35 minutes, depending on traffic on the A4050 and A48(M). It's the only option that doesn't involve swapping vehicles partway through.
The Public transport works too. The TrawsCymru T9 airport express bus runs regularly between the airport and Cardiff Bay and the city centre, taking around 30 to 40 minutes. Rail is possible as well, though it's not quite a single journey: you'd catch a short shuttle bus from the terminal to the airport's own station first, then board a train into Cardiff Central.
If you're travelling light and on your own, the bus is hard to beat on price. It gets trickier with a family in tow, a late landing, or a week's worth of luggage. That's where a pre-booked transfer earns its keep: no timetable to work around, no bags to haul between a shuttle and a platform, just one vehicle and a driver who already knows your flight number.