Hindu antyeshti is described within the tradition as the final samskara, the last in a sequence of rites that began before birth, and its logic is continuous with what came before. A life punctuated by offerings into fire ends with the body itself as the offering.
The chief mourner, traditionally the eldest son, lights the pyre. Partway through the burning he performs kapala kriya, striking the skull to open it, which is understood to release what is held there. The ashes and remaining bone are collected and immersed in flowing water, ideally the Ganges, and the family enters a period of impurity that ends with a formal rite.
The work is not over at the pyre. Over the following days offerings of rice balls are made, and these are understood to build up a subtle body for the deceased, who until then is in an unsettled and slightly dangerous state as a preta. A further rite incorporates the newly dead into the company of the ancestors, and an annual offering thereafter maintains them. The full sequence is set out at length in the Garuda Purana, which is read to the bereaved during the mourning period and is the text most families encounter for it.
There are exceptions and they are instructive. Very young children are buried rather than burned, and so are renunciants, who performed their own funeral rites at the time of their initiation and are held to have no further ritual debt to discharge. What determines the treatment is the person's ritual standing rather than any general rule about bodies.
Buddhist cremation follows the treatment of the Buddha's own body as described in the Pali canon, and it produced relics, which were divided and enshrined. The stupa as an architectural form starts there, which means that a very large amount of Buddhist sacred architecture is downstream of one funeral.