Legality refers to whether or not something (whether it be a transaction, document, object, person, or a person’s actions) is in accordance with the law. If something is in accordance with the law, then it is legal and if something is not in accordance with the law, then it is illegal (it lacks legality). In contract law for example, legality of purpose is required of every contract in order for the contract to be enforceable.
[Last updated in June of 2023 by the Wex Definitions Team]