For example, the shoulder. Vertical range of motion in the plane that divides forward from backward is usually limited by either the torso or the head getting in the way. Being flexible increases the enjoyment we get in life, and can help in minimizing injuries.
Flexibility is somewhat inherited, but it is influenced a lot by training.
We can lose flexibility through not putting the joint through a full range of motion, often enough. We can also lose flexibility by adding muscle. Although this is largely due to the previous reason anyway. The way we increase flexibility is through stretching. The joint is moved through its range of motion until the point of discomfort is reached, where it is held for something on the order of 20 seconds.