According to Section. 23, the consideration or object of an agreement are lawful unless: (i) It is forbidden by law, or (ii) is of such a nature that it would defeat the provision of law, or (iii) it is fraudulent, or (iv) it involves or implies injury to the person or property of another, or (v) the court regards it as immoral or opposed to public policy. In each of these cases, the consideration or object of an agreement is said to be unlawful. Every agreement of which the object or consideration is unlawful is void.
(i) Forbidden by Law: When something is forbidden by law an agreement to do that is unlawful viz. sale of liquor without licence, an agreement to pay money if a person commits a crime or tort, etc. However, merely because a person does not observe statutory requirements do not mean that the agreement is void.
(ii) Defeats the Provisions of Any Law: Sometimes the object of, or the consideration for, and agreement is such that, though not directly forbidden by law, it would, if permitted, defeat the provisions of any law. Thus according to the Mohammedan law is not competent to parties contracting a marriage to enter into separation deed by which the husband covenanted that his wife might live with her parents.
(iii) Fraudulent purpose: An agreement made for a “fraudulent” purpose is illegal, viz. an agreement to defraud creditors, or to defraud revenue authorities, or investors in a company. But if two person agree not to compete with each other, and one of them in consideration for the other person not competing in the submission of tender agree to pay a certain sum of money, the agreement does not aim at defrauding anybody, and the same is enforceable.
(iv) Injurious to Person or Property: An agreement between two person to injure the person or property of another is unlawful, viz. an agreement to commit a crime or civil wrong, for example, to assault or beat a person or to publish a libel against him. If the borrower of money is made to execute a bond to manual labour and until repayment, and in default agree to pay exorbitant rate of interest, the agreement was held to amount to slavery and thus opposed to public policy and, therefor, void.
(v) Immoral: The law does not allow an agreement tainted with immorality to be enforced. What is “immoral” depends upon the standards of morality prevailing at a particular time and as approved by the courts. For instance, A, who is B,s Mukhtar, promises to exercise his influence, an such, with B in favour of C, and C promises to pay Rs. 1,000 to A. The agreement is void, because it is immoral.