According to the tantras of Nyingmapa, the generation stage consists of three types of samadhi: the samadhi of thusness, the samadhi of universal manifestation, and the causal samadhi.
Through the three samadhis, the three phases in samsara, it's the death, intermediate state, and rebirth.
These three phases can be transformed into the dharmakaya, sambhogakaya, and nirmanakaya of the Buddha. The three kayas are the fruition, the three samadhis are the path, and the three phases in samsara are the impure ground.
Universal manifestation refers to phenomena, primarily great compassion. After the completion of the samadhi of thusness, practice great compassion toward sentient beings who have not gained realization of emptiness; it need not be long.
One of the functions of the samadhi of universal manifestation is to transform the bardo body into or purify the body as sambhogakaya.
Although the sutra also practices great compassion, it does not have the ability to purify because it lacks the view that sentient beings are Buddhas already. Another function of the samadhi of universal manifestation is to eradicate the nihilistic view.
When a realized practitioner practices great compassion and loving kindness while in the enlightened state, compassion and loving kindness are in union with emptiness and at once illusory; when the view of Vajrayana is added, this practice is empowered to effect transformation or purification.If the first two samadhis are missing, a practitioner who is undertaking the practice of the wrathful deity will develop attachment to the wrathful deity due to ignorance of the void nature of the deity; absent compassion, if such a person holds the wrong view or mistaken aspiration at the time of death, he or she may end up being a demon or evil spirit with supernatural power in the next life, causing great harm to sentient beings.
This is why the two samadhis are indispensable. If all the generation stages can be practiced around the framework of these two samadhis, there will be no room for mistake because the practice is based on emptiness and compassion.
Visualization not based on the view of emptiness and compassion is also practiced by non-Buddhists; some of these visualizations are quite powerful as well, but they do not lead to liberation.
In other words, with no concept of emptiness nor foundation in compassion, one cannot attain any supramundane accomplishment in the deity practice.
Attaining Buddhahood is called the resultant stage. As we have not yet attained Buddhahood, it is called the causal stage. In actuality, all phenomena are the mandala of the Buddha; cause and result are inseparable, but there is still a discrepancy between cause and result on the surface.
The causal samadhi covers a very broad range, including visualizations of all the peaceful and wrathful deities.
*Footnote