Leasing is an interesting concept. Let's take a $40,000 car for an example. You lease 3 years and they predict a residual value of $20,0000, so you pay that difference over the 36 months, plus whatever interest rate they cite, presuming you don't get wear and tear and additional mileage (which is a killer).
If you buy the car outright, you can usually negotiate a deal on it and perhaps pay $37,000. Now after 3 years your vehicle might be worth $20,000 and you're out $17,000 in depreciation, in simple terms, not including taxes etc. If you keep the car 5 years, or better, 10 years, you end up way ahead if course, but if you keep it only 3 years, leasing can be more attractive because you don't have to try and sell or trade the car and get a lousy deal on that.
We kept our last car only 4 years, so we'd have been better off leasing, but the salesman told me he couldn't give us that price on a lease so it had to be a sale, it was a "loaner car" with 4,000 miles on it, so there was a steep discount (fortunately). I traded it in on the GTI and the dealer allowed me what the book had said, which was a surprise. It was fairly low mileage (41,000) and in perfect shape.
The problem with leasing IMHO is that folks can buy a more expensive far for the same payment as they would if they bought it, so they do, and they of course end up after 3 years with zero equity, and get "hooked". It's best to pay cash for the car and keep it a long long time, and better yet to buy used if you can, something off lease. Don't get swayed by these "Factory Reconditioned" or "Certified preowned" whatever claims, those are mostly bogus.
Best option is to buy a preleased car and let someone else take the depreciation, and then keep it a long time. Cars last a long time these days with little or no repairs.