The belief that human beings survive death in some form occurs in all religions, past and present.
The most elaborate known preparation of the dead took place in ancient Egypt. Because the Egyptians believed that the body was essential for a proper afterlife, a complex process of ritual embalmment was established. This process was intended not only to preserve the corpse from physical disintegration but also to reanimate it. The rites were based upon the belief that, because the dead body of the god Osiris had been preserved from decomposition and raised to life again by the gods, the magical assimilation of a dead person to Osiris and the ritual enacting of what the gods had done would achieve a similar miracle of resurrection [Brandon, Samuel, Death rites, Encyclopaedia Britannica, 2018, <https://www.britannica.com/topic/death-rite#ref66357>.
In Ancient China, the great majority of people held beliefs and observed practices related to death that they learned as members of families and villages, not as members of organised religions. Buddhism, Confucianism, Taoism, and other traditions contributed many beliefs and practices to popular religion. These traditions, especially Buddhism, included the idea of personal cultivation for the purpose of living an ideal life and, as a consequence, attaining some kind of afterlife salvation, such as immortality, enlightenment, or birth in a heavenly realm. However, the emphasis was mostly on (1) passing from this world into an ancestral realm that in key ways mirrored this world and (2) the interactions between living persons and their ancestors [Jochim, Christian, Chinese beliefs, Encyclopedia of Death and Dying, 2018, http://www.deathreference.com/Ce-Da/Chinese-Beliefs.html>.
The most enduring Egyptian view of death was that it was a paradise, a continuation of life on earth but lacking any disappointment, loss, or distress. A text known as The Lay of the Harper [scroll down to the bottom of the page], dating from the Middle Kingdom (2040-1782 BCE) encourages its audience to make the most of the time because death is a certainty.
In ancient China it was believed that death was just a prolongation of life. Instead of believing in individual salvation, the ancient Chinese believed that the dead would continue in the spirit life much as they had done in this life. Thus provisions were made for those that had died for use in the afterlife.
In noble and royal funerals these tombs and grave goods could rival those used by the living. In some royal Shang Dynasty (1600B.C. – 1046 B.C.) tombs a practice emerged of taking servants and concubines to the grave with them, and what’s more, the hundreds of skeletons uncovered have indicated that these sacrifices may have been interred alive. However as time passed human sacrifice stopped. By the Han dynasty (206 B.C. – 220 A.D.), pottery figures were increasingly used instead. However this did not make these graves any less impressive: Liu Sheng’s tomb in Mangheng was designed like an actual house, complete with windows, stables, storerooms, cookbooks and a bathroom, while the discovery of the ‘Terracotta Warriors’ in 1974 uncovered a massive burial complex, complete with 8,000 soldiers, 130 chariots with 520 horses and 150 cavalry horses, acrobats, strongmen and officials.
This tradition would only get more popular. By the Song Dynasty (960-1279 A.D.) fairly cheap grave goods could be mass produced, giving the less well off the chance for a sumptuous afterlife.
In addition to this, it was believed that children had obligations to their ancestors for the sacrifice they had undertaken in having children and that as in life these duties continued even after death. Spirits in ancient China had the power to influence people’s lives on earth and that if they were not cared for by the living they might return, causing untold mischief. Thus an ancestor cult emerged, with people making offerings and observing ceremonies for their line of descendants.
Even the dead were buried with sets of bronze vessels, thought to be so that they could continue making offerings to their own ancestors. This developed further with Confucian influence, which instigated ‘spirit tablets’ to be placed in the family shrine and revered, with offerings to remoter ancestors being made at longer intervals than to those who had just died.
Source: History Channel