Why did the ancient Egyptians build pyramids?

Why did the ancient Egyptians build pyramids?

The ancient Egyptians built pyramids as tombs for the pharaohs and their queens. The pharaohs were buried in pyramids of many shapes and sizes from before the beginning of the Old Kingdom to the end of the Middle Kingdom. Why did the ancient Egyptians build pyramids?...