capacity: the power to learn or retain knowledge; in law, the ability to understand the facts and significance of your behavior
ability: possession of the qualities (especially mental qualities) required to do something or get something done
obsessive-compulsive disorder: an anxiety disorder characterized by recurrent and persistent thoughts and feelings and repetitive, ritualized behaviors