Understanding contract law involves recognizing various elements that determine the enforceability and validity of agreements. Illegality can render a contract unenforceable if it involves criminal activities or torts, potentially invalidating the agreement and penalizing the parties involved.