I remember hearing an expression growing up that went something like, "Buying a used car is buying someone else's problems."
I am not saying most sellers are intentionally selling lemons. A person may sell a vehicle for a variety of reasons, but you never know which ones are selling lemons, and it's a gamble at the end of the day.
My current car is over 20 years old. It rarely has issues, and has never cost more than about $1500 to fix all of them at once. It wouldn't be worth a lot on the used market. Practically any repair of $500 or more starts to get into "but how much is it worth" territory.
My comparison is not "how much is it worth", but "how much would I have to pay to get a similar vehicle with a completely known history of good maintenance, and how much would I have to spend for a new one?"
I spend about $1000-1500 a year on it for maintenance - oil changes, tires, brakes, things that break on a 20-year-old truck - and there's just no way that any new car can compete with that. If I could buy its twin for $5k, I probably would. Not because it's an amazing vehicle, because it's not. But having a completely spare car is GREAT. Primary car needs service? Keep it for a week, I don't care. One won't start in the morning? Take the spare, figure out the rest later.
I am not saying most sellers are intentionally selling lemons. A person may sell a vehicle for a variety of reasons, but you never know which ones are selling lemons, and it's a gamble at the end of the day.