That's why you thoroughly inspect a used vehicle before you buy it, so you don't end up with a basket case haha. I wouldn't even consider buying a "basket case" no matter how cheap it was.
One thing to bear in mind is that what one person thinks is a nice car, another might find a million problems with. I bought a 92 Toyota Corolla with no functional door handles, except the outside one on the driver door, non operational front power windows, some of the threads for the exhaust manifold stripped out of the aluminum head, and other cosmetic issues (at least I considered them cosmetic). Everyone thought I was nuts for buying it, but a few hundred dollars and a few day's work turned it completely functional. I have driven it for a year and a half, often lending it to my mother (I take her willingness to drive it as proof of its functionality), and now plan to sell it for more than I have invested in it.
The converse of the Corolla situation was a 99 Mustang I bought. It was unbelievably clean, and everyone that rode in it thought it was great. I knew however, that it had some issues imminent, and sold it after a year, before I had to mess with it, and while it was still worth more than I paid for it. I would have likely lost my ass on it if I kept it.
My point is, just because a vehicle runs and drives nice, doesn't mean that it doesn't have some imminent issues that won't necessarily rear their head on a test drive. I bought my truck thinking it had a good motor. Little did I know, a previous owner had replaced one hydraulic lifter, and one rocker. The cam was ruined, and the motor needed valves and rockers. That problem was not evident until after I had bought the truck and removed the valve cover. There are obvious, major issues you
can spot, like dogtracking, damaged or severely worn suspension components, obvious drivetrain issues, etc, but there are those that anyone could miss as well.
Vehicles need work. Sensors die, bushings and ball joints wear out, bearings wear out, things rust and break, the list goes on. For your average person, I would say unless you replace your vehicles with newer ones every decade or so, they will need some major repairs and restoration work at some point. I just overhauled the suspension on my mother's 96 Honda Accord at a cost of nearly a grand. That's just for parts, I did the work, so there was no cost for labor. However, I used quality parts, and I know now that I will not need to repeat that job for quite some time.
I have bought and sold a lot of cars in my time, most of them belonging in the junkyard when I bought them. I did well on some, and not on others. I also worked on cars in a dealer for a couple years, and saw that just being fairly new is still no guarantee that a car won't be a pain in your ass. To me, it's about more than just being able to say I worked on or built something. It's about feeling certain that it is right. I have owned my Ranger longer than any other vehicle, and have worked to improve it over the entire time I have owned it. It is nothing extraordinary or impressive, but I feel like I could drive it to hell and back. Sorry for writing my life's story here. Guess I need to work on being a little more concise. Oh well.