The scarab was of prime significance in the funerary cult of ancient Egypt. Scarabs, generally, though not always, were cut from green stone, and placed on the chest of the deceased. Perhaps the most famous example of such "heart scarabs" is the yellow-green pectoral scarab found among the entombed provisions of Tutankhamen. It was carved from a large piece of Libyan desert glass. The purpose of the "heart scarab" was to ensure that the heart would not bear witness against the deceased at judgement in the Afterlife. Other possibilities are suggested by the "transformation spells" of the Coffin Texts, which affirm that the soul of the deceased may transform (xpr) into a human being, a god, or a bird and reappear in the world of the living.Via Uncertain Times.
One scholar comments on other traits of the scarab connected with the theme of death and rebirth:
“ It may not have gone unnoticed that the pupa, whose wings and legs are encased at this stage of development, is very mummy-like. It has even been pointed out that the egg-bearing ball of dung is created in an underground chamber which is reached by a vertical shaft and horizontal passage curiously reminiscent of Old Kingdom mastaba tombs."