Immunity refers to the state of being protected against a disease or a penalty, often as a result of legislation or political rights. This can include protection against infectious diseases, or protection against penalties resulting from lawbreaking.