For most folks, the reason they pay the big bucks, discounting ego (eg Mercedes CLA, BMW 320i) is for a warranty. This is a promise that if it breaks, someone else will fix it, on an open ended contract. This is the warranty premium, and what sells most new cars. (I"m sick of my POS whatever, I was late again, I NEED A NEW CAR).
Interestingly, repair costs are set up specifically to be just a bit more than car payments when the car begins to age...at dealer prices....
Now, in reality, it isn't that simple, but you need 99% uptime to get to work, and it plays into that. If you can afford two cheaper cars, you don't need that 100 % uptime from one, and it can be cheaper. You need space, so city dwellers can't do this.
If you can do some work on the car yourself, or have basic knowledge such that you can discuss reasonably with a service tech, you can buy used pretty safely. If you know where the gas goes and the key goes, and the "check engine" (yup, still there) light scares you and results in random $500 bills, then you can't buy used.
I'm driving a $50k car (new) that I bought used for $16k. I did $2500 in catch up work and this includes an alternator which puked 15k miles after I got the car. Most folks think I'm driving a $50k car, but as I have another car, and I DIY most work that does not need a lift, I can afford to drive a used car.
Mileage is a factor. Warranty is because they know how much folks drive, so 3 yrs/36k means I'm out of warranty early year #2. It is brief warm feeling, like a towel out of the dryer....so new, for me, isn't equal to warranty.
You can do a LOT of repair work for the "warranty premium, even a whole engine in most cases".
Again, this only works if you have some space, and understand the mechanics. Otherwise, they are awfully good at separation of you and money, aren't they ?