Updated: Oct 15, 2022
In Sanskrit and Pāli, yoga literally means 'yoke.' Like the yoke put by farmers on the neck of oxen. In a more metaphorical sense, yoga can also means 'method' or 'practice.' The idea is that one imposes certain rules, restrictions, bounds upon action for the sake of directing and strengthening it.
Today, Western people are familiar with many styles of yoga, which is usually understood as a psycho-physical discipline aimed at induce a degree of mental relaxation and clarity by a methodical enaction and manipulation of bodily postures (asanas). This approach is particularly apparent in Ashtanga Yoga, which has been popularized in the West by K. Pattabhi Jois (in the picture below) and his many students. Ashtanga Yoga combines a fixed sequence of postures, joined by transitions, the whole synchronized with breath and gaze. A perfect mechanism for yoking mind and body.
The idea of yoking the mind through deliberate forms of practice is a very widespread notion in antiquity, and especially in ancient India. The discourses of the Buddha offer one of the oldest and perhaps the most extensive account of how idea was developed.
In the orthodox Indian context, yoga is usually understood as a method for yoking the mind to an object, in order to foster a degree of sensory withdrawal. As this process deepens, the (very advance) practitioner might reach a state of 'anesthetic trance' in which all contents of experience vanish and there is no more any specific object one is paying attention to. Since in this condition there is no perception of differences or becoming, the experience feels like something eternal or outside of time and space (or perhaps it doesn't feel at all). This is interpreted as a glimpse into 'ultimate reality' or the getting in touch with the underpinning unitarian principle behind all phenomenal diversity (Brahman).
The Buddha was aware of these teachings (cf. MN 26) but he disagreed with the metaphysical interpretation offered. He did not find that the state of intransitive awareness or anesthetic trance reached through yoga led to any eternal and transcendent reality. The peculiarity of the Buddha's approach to yoga consisted in cultivating a sustained degree of metacognitive awareness about how the whole meditative process was created step by step.
This led the Buddha to recognize that wherever there is any sort of experience, that experience is constructed to that degree (the practitioner is actually manipulating their perceptions and feelings and intentions in order to bring about and sustain that experience). By contrast, when all activity really ceases without remainder, then experience ceases as well (cf. MN 121), which means that one cannot experience the state of pure inactivity, and hence that cannot be an experience of any reaching towards something transcendent.
The Buddha did not dismiss the practice of yoga, but gave a different twist to it. Instead of yoking attention to a specific object for the sake of filtering out anything else, the Buddha rather encourages to establish attention upon a certain context, for the sake of understanding any other content of experience unfolding within that. Instead of zooming in, one is encouraged to zoom out. This practice ('recollection,' sati) does create a yoke for attention, by establishing a frame of reference to assess any deviation and drifting away of intentionality from the chosen context (the bodily posture, for instance, or the breath). Behind distractions there are other currents of intentionality that compete for attention (the five hindrances), and that is what one wants to really investigate and observe in detail. In this case, proficiency in yoking attention to a context results in an enhanced ability of discerning the constructed nature of any experience.
Whatever is constructed is contingent and uncertain (anicca). Whatever is uncertain cannot bound anybody. That's where attention becomes unyoked, freed.