You must pay every dollar of the value of the car as agreed to on the lease. Period.
Some people carry insurance. This insurance will pay out based on the insurance policy. The usual default is that the insurance will buy you a non-smashed used car of comparable make, model, age and trim options. Minus any deductibles.
Note that these are two different numbers calculated in two different ways.
Generally if the second is larger than the first, the money goes into your pocket. That is your equity in the car.
If the first is larger, that means you were upside-down on that car (negative equity) in which case you must pay the difference.
How would you get upside down? One of several ways. That isn't uncommon in a lease, your car takes the biggest depreciation hit the moment you drive it off the lot. It's now a "used car" and sells for less. Or, your previous lease may have been upside down, and rather than make you write a huge check, they folded this debt into your next lease. Happens all the time, and I just described how you can bury an upside-down loss into another new car purchase.
If you don't have the pile of cash to settle up, you can't just shrug it off like a non-recourse mortgage. You must arrange to settle the debt. Assuming you need a car, practicality may well drag you to do it again, buying another new car simply to rollforward the debt you can't pay.
It is also possible to buy gap insurance to cover exactly this eventuality. The lender might even make you buy it (not unlike a house's PMI). Obviously gap insuance won't cover old debt you rolled into this lease...