I'm not a lawyer, so this is practical experience, not professional advice.
When someone signs a contract stating they own something, they are putting themselves squarely in the firing line in the case that they don't. So this is largely a case of trying to mitigate caveat emptor ("let the buyer beware!").
Depending on the form of IP under question, more extensive due diligence is going to seek out and examine all documentation. If there are patents, where are they, what's their status, who's named, are there any loose ends? If there is code, who wrote it, where are all the contracts assigning rights, are open source licences being respected along with any other third party components?
If the primary asset being bought and sold is IP, then you can expect the scale of the due diligence to reflect the price and potential value, and the complexities of the specific category of IP.