Yoga has its roots about 5000 CE but the first book of yoga, the Yoga Sutras, was written by Patanjali, compiled around 400 CE. Patanjali took materials about yoga from older traditions and created what is generally considered, "the finest distillation of yogic philosophy" (M. Hirschl). In the Yoga Sutras an 8 limbed path of yoga is identified for the yogi to follow (Ashtanga: Ashta' means 8 and 'Anga' means limbs). In brief, the 1st limb consists of Yamas (a set of ethics, ensuring harmonious interaction with the surrounding community). The 2nd limb consists of Niyamas (observances for physical and mental 'cleanliness'). The 3rd limb is asana (seat/ postures). The 4th limb is pranayama (study and exercise of ones breath). The 5th is pratyahara ( sense withdrawal). The 6th is dharana (concentration). The 7th is dhyana (meditation). The 8th is samadhi ( freedom from external stimulation).
So the 3rd limb, asana, describes how to be happy and peaceful in our bodies. No specific poses are described in the Yoga Sutras (it is not until hundreds of years later detailed descriptions of poses appear in texts), but the overall goal of yoga practice is given as that of attaining steadiness and happiness. Past emotions, thoughts and impressions manifest in the body in different ways and asana practice is the method to release this past conditioning that is stored in the body. For example, anger experienced in forward bends may be due to past anger being stored in the hamstrings. Emotional pain can be stored in the chest, where it functions like armour hardening around the heart; this can be dissolved in back bending. Extreme stiffness may relate to the inability to move into unknown situations, so developing more flexibility may release this fear. Extreme flexibility may relate to inability to set boundaries, so strength and learning to resist being stretched too far can be developed in asana practice too.
In this way, the 3rd limb of the 8 limbed path, focuses on poses that help us become stronger, more flexible and more balanced but they also benefit us emotionally and spiritually.
The key to increasing the awareness and the benefits of all of this, is by using the BREATH. Using the breath to become a witness to the sensations resulting from the poses. The breath is what links body and mind. Breath, prana, the life force: "Without prana the body is dead and without prana the mind is utterly inert. It is prana that moves both. ... Pranayama (breath work) is the axis around which the wheel of eight-limbed yoga revolves". ( Greogor Maehle).
(Bibliography: Meta Chaya Hirscahl, 'Vital Yoga' and Gregor Maehle, 'Ashtanga Yoga Practice and Philosophy)