Rava quotes Rav Nahman as teaching that when someone rents a house to another person for ten years, and makes sure to write a contract, if the landlord later claims that the renter has already been in the house for five years of the rental period, he is deemed credible.
Rabbeinu Hananel explains this statement as dealing with a question of payment, and Rava is teaching that there is a written, dated contract stating the agreed-upon price, and there is a dispute as to whether the renter paid his rent.
This explanation is rejected by most of the commentaries, largely because it does not fit in with the simple reading of the Gemara.
Rashi suggests that Rava is talking about a case where the written contract has no date in it, and the owner and the renter disagree as to how long the renter has been living in the house. According to this approach, the point of the contract was to act as proof that there was a rental and not a sale, since the written contract effectively publicized what their agreement was. Given that there is no date, Rava teaches that we believe the owner’s claim about when the rental agreement began.
Jewish law does not recognize “squatters’ rights.” Just because someone lives in a house or works a field for a number of years, he does not have the right to claim the land for his own – if the true owner appears with proof of ownership, the land belongs to him. Nevertheless, if someone has been living in a house or working a field for three years or more, he has a hazaka – circumstantial evidence – that the land belongs to him which will support him should he claim that he purchased the land and someone else argues that he owns it. In our case, the owner wanted to guarantee that it would be clear to all that the land had not been sold, so he wrote the contract.