Gap insurance covers the difference between what the car is worth and what you owe on the car. It comes into play if the car is stolen or totalled (damaged to the point that repair would cost more than the car is worth) while the owner is still making payments.
Let's say you buy a new car for $30,000. You put $750 down and your payments are $500 per month. Six months after buying your car, it is involved in an accident and totalled.
Your collision insurance company determines that your six-month-old car is now worth only $23,000. They will pay you that amount (less your collision deductible if the accident is your fault). You've made six monthly payments plus your down payment, for a total of $3,750; you still owe $26,250 on the car. In a case like this, gap insurance would pay the $3,250 difference between what collision insurance covers ($23,000) and what you owe on the car ($26,250). If you did not have gap insurance, the extra $3,250 would come out of your pocket.
For buyers, gap insurance makes sense if you expect to be "upside down" on the car (you owe more than it is worth). If you made a low down payment, if you bought a car that depreciates rapidly, if you have a high interest rate or if you rolled over other costs, such as money owed on a trade-in, into your new-car payments, gap insurance makes sense.
People who may owe more than the car is worth for a set amount of time.