While I've been fortunate to not ever had a title claim situation, I have had a few instances where a title company was able to bring resources to an issue that might have become a bigger problem in the future!
Recently, I was involved in a transaction where the seller, when purchasing the property a few years prior (direct from another party for cash - no Realtors or lenders involved), neglected to require title insurance from the seller. When he decided to sell, the lack of a clear chain of title became a huge impediment to the sale, requiring several months of paperwork and affidavits to provide the title insurer for the the current transaction confidence that they could deliver clear title to my clients (in this case, the buyers). So the good news is that my clients are covered should there ever be a title issue in the future -- most likely when they sell the property down the road. They should have smooth sailing at that point
Another situation arose when it was discovered that a portion of the back yard of a property in which I was involved selling was thought to belong to Cal Trans. As it turned out, the property still belonged to the family of the original developer of the tract. My clients were able to use the property, but at some point the owners could put up a fence (and likely get rights to an easement across my client's property for access) to build a billboard, cell tower or other use that was suitable to a long, narrow strip of land adjacent to a freeway.
And the the last example that I recently encountered was a simple structure that a neighbor had built that crossed my client's property line. Fortunately, it was shoddy construction and easily removed (which the City required/enforced upon discovery). Again, the title insurance company sent out an inspector to confirm that the structure was not infringing upon the neighboring property -- title insurance couldn't be obtained until the offending structure was demolished.
So when you see title insurance on your closing statement, whether buying or selling, rest assured that it is a valid service and may very well protect the largest asset that you own!