When you purchase a property, you are entitled to certain benefits from ownership. You occupy and use the property as you wish. You expect the property to be free from any debts of the prior owners. You are also able to freely sell or use your property as collateral for a mortgage. Title insurance exists to protect against any limitations of these rights.
When you purchase a property, an owner's title insurance policy protects you, the buyer. If you get a mortgage, either when you purchase or refinance, a loan title insurance policy protects the lender.