Mental competency refers to an individual's ability to understand and participate in legal proceedings, make informed decisions, and comprehend the consequences of those decisions. In the context of the legal system, it is crucial for ensuring that individuals are treated fairly and justly, particularly when facing serious penalties or conditions such as cruel and unusual punishment. The evaluation of mental competency often involves psychological assessments to determine whether a person can adequately engage with the legal processes that affect their rights and liberties.