What was the intended purpose of the Egyptian pyramids?

A) to serve as aqueducts
B) to serve as royal tombs
C) to serve as prison chambers
D) to serve as protection from intruders