When the sun set and twilight came, he and his vessel passed through the akhet, the horizon, in the west, and traveled to the underworld.
Every night enormous serpent Apophis, the god of chaos (isfet) attempted to attack Ra and stop the sun-boat's journey.
After defeating the snake, Ra would leave the underworld, returning emerging at dawn, lighting the day again.
[4] The progress of Ra upon the Mandjet was sometimes conceived as his daily growth, decline, death, and resurrection and it appears in the symbology of Egyptian mortuary texts.
Thus, as the pharaoh was a representation of the sun god on earth, the king would use a similar boat upon his death to travel through the underworld on their journey to the afterlife.