Cannibalism, or eating the flesh or internal organs of other humans, has existed in many cultures around the world since before modern humans evolved about 100,000 years ago. There are a variety of reasons for this including attempting to capture the spirit of the dead person, triumphing over an enemy or surviving in times of famine.
The Wari people from the Amazon rainforest used to cook and eat the flesh of a loved one after their death as a way to support the grieving process and to help the spirit of the dead person continue in the bodies of the living. The Yanomami people of Brazil still mix the cremated remains of their loved ones with mashed bananas and eat the mixture in order to save the souls of the dead from being lost.