The Brahmaviharas in Buddhism are the four beneficient qualities of metta (lovingkindness), karuna (compassion), mudita (empathetic joy), and upekkhā (equanimity.) Brahmavihara literally means 'abodes of Brahma' or 'the divine abodes', sometimes also translated as 'the sublime attitudes.' These qualities are also known as apramana (Pali) or appamanna (Sanskrit) or 'the four immeasurables.' Immeasurable in this case means limitless or boundless, because when we truly cultivate these states of mind our awareness is infinite.
Here is more on each individual immeasurable:
Metta (lovingkindness): The true hope that all sentient beings, without exception, be happy. The key phrase here is 'without exception’ – cultivating true metta means that we wish as much happiness to our enemies and those who challenge us as we do to those we love. We are focused on our commonality, as opposed to our separateness.
Karuna (Compassion): The wish that all sentient beings may be free from suffering. Like metta, the key to cultivating true karuna is extending it to all beings. Karuna is the healing force of the world, the caring behind the relief of suffering everywhere.
Mudita (Empathetic Joy): Feeling happy for the accomplishments and joys of all beings. This is the opposite of jealousy – instead of envying others' accomplishments or coveting their gifts or possessions, we are able to feel true joy for them. Mudita is also the counterpart to compassion – in addition to feeling compassion for others' suffering, we also feel joy for their happiness.
Upekkha (Equanimity): Meeting both success and failure, pleasure and pain, with equal attention, and regarding every sentient being in essence as equal. Equanimity is not a cold detachment or emotional numbness, but instead a tranquility that comes from openness and acceptance, rather than from a judging or critical attitude.
Like most teachings in Buddhism, the immeasurables can be understood on many levels. On one level, they are virtues, and by striving to embody them within our daily life through our actions, we create positive karmas that counter negative ones. On a subtler level the immeasureables are states of awareness, and through meditation we seek to embody them wholly. It is not enough to simply act in accordance with these virtues; instead we wish for them to become the foundation for our moment-by-moment awareness.
There are many meditations and practices related to cultivating the four immeasurables that are taught within the various branches of Buddhism. The most common is some version of this simple prayer, each line of which is related to one of the four:
May all sentient beings have happiness and its causes,
May all sentient beings be free of suffering and its causes,
May all sentient beings never be separated from bliss without suffering,
May all sentient beings be in equanimity, free of bias, attachment and anger.
Mahayana Buddhism teaches that cultivating the four immeasurables lays the ground for the seeds of true boddhicitta to sprout - the willingness to work for the awakening of all sentient beings. All of the immeasurables – and boddhicitta – spring from a true realization of interconnectivity. When we know ourselves as connected to all beings, rather than separate, we naturally shift from an 'I' to 'other' centered focus. We are able to experience both the pains and the joys of all beings as our own, and to wish for awakening for all.