I'll tell you how it works in Florida and Michigan, having been a realtor in both states. In the example of a cash purchase, the seller pays for the title insurance. This is an insurance policy purchased by the seller that guarantees clear title to the property. It is issued by a title insurance company, in effect insurring the purchaser that the title history has been searched and that there are no liens or encumberances on the property. If something should come up later, like a mechanics lien discovery, the insurance would compensate the purchaser. So, it's the sellers obligation to provide the clear title, and to provide that the title is clear, the seller purchases this owners title insurance poliicy.
A mortgage title insurance policy is purchased by the buyer to insure against default of the mortgage. At the closing, an owners title insurance is still provided by the seller at the sellers expense but another insurance policy is issued by the title insurance company insuring the mortgage. Normally there is a discount for the mortgage insurance policy because most of the work has already been done by the title company.
Some years back my siblings and I sold our folks home in Ohio to a banker. I was handling the sales agreement on our behalf. I disclosed that I was a realtor in Florida so the purchaser knew what was going on. He presented the family with the sales agreement and in it noted that it was "his responsibility to do the title search and it would be done by an attorney of his choosing and at his expense". I said OK by us. I guess I learned in real estate school about title searches by attorneys. Normally they do a good job, but should they screw up, you would have to sue them to recover any losses.
The owners title policy is issued in the amount of the purchase price. The mortgage policy is issued in the amount of the mortgage.
Editing to add the following note:
Everything is negotiable. For example, if you are the seller, you might talk the buyer into paying for the owners title insurance policy which is typically around $1000 for a $200k house.