Ability, capability, and capacity are synonyms in many of their uses. But they are actually different things.
If someone has ability, a particular ability, or the ability to do something, they can do it because they have the skill or the knowledge that is needed to do it. You often use ability to say that someone can do something well.
“He had remarkable ability as an administrator.”
“She has ability to read minds.”
“…the ability to bear hardship.”
A person’s capability is the amount of work they can do and how well they can do it.
“The director has his own ideas both of the role and of the capability of the actor.”
“My communications capability is limited.”
If someone has a particular capacity, a capacity for something, or a capacity to do something, they have the characteristics required to do it. Capacity is a more formal word than ability.
I am amazed at the human brain’s capacity to remember so many things.
…their capacity for being inspired by heroes.