If you've practised any yoga at all, you will know that breathing technique and application plays a very important role in asana practice. If you take short, shallow breaths or stop breathing completely (it's very common for new yoga practitioners to hold their breath while they try to figure out each posture) the practice becomes exponentially more difficult, and there's a good chance that you'll finish your practice feeling exhausted and agitated rather than relaxed and uplifted.
Rapid breathing is activated by stress and part of the "fight or flight" response, which is controlled by the sympathetic nervous system. This is helpful if you actually need to fight off or flee a perceived threat, but prolonged release of stress hormones related to this reaction (adrenaline and cortisone) can impair your immune system, reducing your body's long-term ability to fight off disease.
Conversely, slow, deep breathing activates the opposing system - the parasympathetic nervous system - which helps to calm us down. This process relies upon a neurotransmitter called acetlycholine, which is responsible for learning and memory, but also serves to relax the entire body by reducing stress hormones and softening the muscles.
Many scientific studies have proven the relationship between breathing and its physiological affects on the body, but it is my experience that most yogis don't know exactly why they're practising a certain breathing technique, simply assuming the all yogic breathing accomplishes the same end goal: greater relaxation.
Although deep, diaphragmatic breathing is encouraged throughout all asana practice, any good yoga class should begin and end with specific breathing exercises, and these will differ between styles and teachers. When your yoga teacher explains the breathing exercise and associated effects, they are not just trying to impress or distract you with esoteric yoga philosophy; breathing exercises can be calming, energising, or balancing and are practised with a particular intention related to the class.
According to the ancient yogis, closing off one nostril at a time and breathing only through the open nostril activates the qualities of whichever channel is being utilised, and calms or limits the reactivity of the opposite channel.
Left Nostril Breathing: this side is connected to IDA energy, which is related to the moon and femininity, and is reflective, calming and cooling in nature. Left-nostril breathing is practised to illicit a relaxation response in the body, also aiding with digestion and elimination, as well as regulation of sleep-wake cycles. This is a calming breathing technique designed to shift your awareness inward and is often practised at the beginning of a relaxing yoga practice to set the mood of the class.
Right Nostril Breathing: this side is connected to PINGALA energy, which is related to the sun and masculinity, and is energising, fiery, and alert in nature. Right-nostril breathing is practised to increase energy and activate the sympathetic nervous system, making you feel more alert and focused. This is an energetic breathing technique designed to uplift the practitioner, and would most often be practised as an opening breath for a powerful yoga class.
Alternate Nostril Breathing: also know as Nadi Shodhana, this breathing exercise is practised by alternating the channel or nadi (nostril) between each full breath, balancing the masculine (HA) and feminine (THA) energies in the body. If you are feeling generally out of sorts, alternate nostril breathing could help you to feel more balanced.
These (and other) breathing exercises can be practised within a yoga class but are also helpful with beginning a meditation practice. To practice one-sided nostril breathing, close off the nostril you will not be using with your thumb and point your fingers upward. Breath deeply in and out through the open nostril. To practice Nadi Shadhana or alternate nostril breathing, start by closing off the right nostril with your thumb, take a deep inhale through the left nostril, then close your left nostril with the ring finger of the same (right) hand, exhaling through the open right nostril. Now inhale through the open right nostril, close the right nostril with your right thumb, and exhale slowly through the open left nostril. (If you're still unsure about the technique, watch this video for more detailed instructions.)