Our body is made of many joint. Each joint has a primary function of either stability or mobility.
Stability can be defined as the ability to resist an undesired movement
Mobility is the degree of freedom of movement around a joint
Flexibility is normal extensibility of all soft tissues that allow full range of motion of a joint. It is your potential movement.
If we have good neuro control over our muscles we can resist undesired movements so that we have stable joints when we are moving. If our body realizes this control is present then it allows more potential flexibility of the joint.