The ancient Egyptians believed in a pantheon of gods who controlled different aspects of nature and often quarreled with one another. They also believed in an afterlife that continued on with the physical body, and that immortality lasted as long as one's name was remembered among the living.
Egyptian religion was a polytheistic one, with a host of gods and goddesses. Each had influence over some sphere of life, and many served multiple roles. For instance, Khnum was the god of the Nile River; since the Nile was the source of life in ancient Egypt, Khnum was also a creator deity. Multiple gods could serve the same role as well, such as Ra and Horus both being associated with the sun.
Mummification came about due to the Egyptian belief that life after death merely meant the body continued on. Since the spirit would have need of the body in the future, it must be properly preserved. Tombs were often stocked with foodstuffs, tools and other important supplies for the deceased to use in the afterlife.
A key concept in the Egyptian afterlife was remembrance. As long as someone's name continued to be spoken, their spirit lived on in the afterlife. This is why some pharaohs took great effort to create massive monuments to bear their names for eternity, and why others took pains to strike out the names of unpopular predecessors as a means of spiritual annihilation.