Insurance cannot prevent something bad from happening.But it helps you recover financially if something does happen to something you value. For example, if your house was robbed, insurance will step in to help you get back to where you were.
When you buy insurance, you pay a premium. This premium joins a pool of premiums from other policyholders. The money from this pool is what is used to pay your claim if the insured event occurs. Insurance companies leverage on spreading risk among a large group of people.
Once a claim is lodged, depending on the type of policy you took, the insurance company will come in and assist through rebuilding/repairing, replacing, providing cash settlement or any other form of compensation as per the policy agreement.
Insurance Companies also need insurance to be able to cover the risks they have insured, this is called Re-Insurance.