The title of a property is one of the essential parts of the contract, as it indicates its ownership. Nonetheless, if this isn't clear, you can protect yourself before buying a property with a title contingency.
This clause is going to give you and the seller enough time to track the title of said property and ensure that it can be sold and transferred to a different person. However, if you end up finding any liens during this search, you can always end the agreement and get your earnest money refunded.
These clauses are meant to give you an extra amount of time to decide whether you desire to go through with the sale or not. Therefore, you need to act quickly and find the whole background of the property before this time expires. Otherwise, you may not be able to get your earnest money back.
The best way to do this is to hire a real estate lawyer who can guide you through the process and protect you against possible lawsuits or scams.
This type of contingency can be used instead of a financing contingency. In the latter, a lender wouldn't give money for a property with an unclear background, so you would have to do a title check. Therefore, if you're not opting for a financing contingency, a title contingency is the way to go.