In contract law, a mistake of fact occurs when one or both parties in a contract have mistaken a term that is essential to the meaning of the contract which result in the contract being voided. In the given case, X agreed to sell a horse to Y but later the horse was discovered to be dead at the time of the contract and hence the agreement is void because both the parties were under a mistake of fact regarding existence of the subject matter.