You give the company money every month or something and then sometimes you get some back but only if it meets certain requirements. So like if you have a certain kind of car insurance and a deer hits your car the insurance pays for most of the repairs.
From a mathematical standpoint though, the only reason insurance companies survive is because they take more money than they give.