Title insurance is big business in the real estate industry. When a buyer contracts to purchase a home, a title insurer's representatives or agents will search courthouse records for all recorded documents pertaining to the property. They'll find land grants, covenants, restrictions, easements, liens and more. The title insurance company will bind to cover the buyer with title insurance if there is nothing of concern in the discovered documents. If there are issues, many times the title insurer will require that they be corrected by closing, and everything moves along normally.
The property owner's policy gives them certain protections against unforeseen and unrecorded claims against their ownership or use of the property that come up after the closing. An example might be a neighbor's claim to ownership or use of a portion of the covered owner's property. If not excluded from coverage, the title insurer would defend the owner and/or pay a claim for damages if the neighbor prevails.
If a mortgage is taken out to finance the purchase of the property, there's another policy issued specifically for the lender. This policy similarly covers the lender up to the amount due on the loan. This is the Mortgagee Policy or Rider. The lender wants to secure their financial interest in the property. These are two separate policies. Depending on what's negotiated, the buyer or the seller could end up paying the premium for the owner's policy, though generally the buyer pays for the mortgagee coverage.