The word Yoga comes from the Sanskrit word "Yuj" meaning to yoke, join or unite. This implies joining or integrating all aspects of the individual - body with mind and mind with soul - to achieve a happy, balanced and useful life, and spiritually, uniting the individual with the supreme.
In India, Yoga is considered one of the six branches of classical philosophy and is referred to throughout the Vedas - ancient Indian scriptures and amongst the oldest texts in existence. The Upanishads are also broadly philosophical treatises which postdate the Vedas and deal with the nature of the "soul" and universe.
However, the origins of yoga are believed to be much older than that, stemming from the oral traditions of Yogis, where knowledge of Yoga was handed down from Guru (spiritual teacher) to Sisya (spiritual student) all the way back to the originators of Yoga, "the Rishis," who first began investigation into the nature of reality and man's inner world.
Legend has it that knowledge of Yoga was first passed by Lord Shiva to his wife Parvati and from there into the lives of men.
According to the Yoga Sutras of Patanjali, the ultimate aim of Yoga is to reach "Kaivalya" (emancipation or ultimate freedom). This is the experience of one's innermost being or "soul" (the Purusa). Then one becomes free of chains of cause and effect (Karma) which tie us to continual reincarnation. In Kaivalya one is said to exist in peace and tranquillity, having attained absolute knowledge of the difference between the spiritual which is timeless, unchanging and free of sorrows, and the material which is not.