They got this idea because as they believed in many Gods, they knew that Osiris was the god of the Underworld. Also the Egyptians believed in a Ka and a Ba. The Ka was the life force, created at birth and released by death. The Ba was like the soul. In order to live for ever and be immortal, the Ka and Ba had to be reunited with the deseased after death.
They believed that once an emporer died, he'd rule the immortal world. So they buried his belongings and dressed him up so he'd look the same in the next life.
They believed that a body should be preserved by mummification. They would oil the body up and drain their insides. They would rap them up in a cloth and then bury them in a pyramid.
They would hold artifacts that they might use in the after life.
They demonstrated their beliefs by preserving the bodies of their dead. Through rituals and ceremonies the body would safely be placed into a good afterlife....that is,.........IF THEY WERE A GOOD FOLLOWER TO THE GODS.
The Egyptians believed that life after death would be a continuation of earthly life. This meant that food, drink and all kinds of objects used during life on earth would be needed. Thus all kinds of things were put into the tombs.