Gap insurance is a protection plan that, in the event that a financed car is written off or stolen, will pay out a sum of money. This is providng the car is worth less as a write-off than is outstanding on finance - the Gap insurer will pay off what's left of the finance for you.
Yes, the finance provider (presumably a dealer) should legally have offered you Gap protection with your finance. You're not legally obliged to take it, but you should have been offered it. I'd be very surprised if the dealer hadn't, as dealers are targeted on Gap figures.