The scarab is the famous beetle image seen in Egyptian art and iconography which represents the dung beetle. The dung beetle was associated with the gods because it rolled dung into a ball in which it laid its eggs; the dung served as food for the young when they hatched. In this way, life came from death.
They were closely identified with the god Khepri who was thought to roll the ball of the sun across the sky, keep it safe in its travels through the underworld, and push it up into the dawn the next day.
When Ra became the pre-eminent sun god, Khepri continued in this role as an assistant. Scarabs became popular amulets during the First Intermediate Period (2181-2040 BCE) and remained so for the duration of Egypt’s history until the rise of Christianity.
Egyptians now are using the scarab beetle as a symbol of luck which has no relation with its origin.