There were at least three separate cosmogenies in Egyptian mythology, corresponding to at least two separate groups of worshippers.1. The Ennead, in which Atum arose from the primordial waters (Neith), and masturbated to relieve his loneliness. His semen and breath became Tefnut (moisture) and Shu (dryness), respectively. From Shu and Tefnut, were born Geb (earth), and Nut (sky), who were born in a state of permanent copulation. Shu separated them, and their children were Ausare (Osiris; death), Set (desert), Aset (Isis; life), and Nebet Het (Nephthys; fertile land). Osiris and Isis were a couple, as were Nepthys and Set.
Over time, the rival groups gradually merged, Ra and Atum were identified as the same god, making Atum's mysterious creation actually due to the Ogdoad, and Ra having the children Shu and Tefnut, etc. In consequence, Anubis was identified as a son of Osiris, as was Horus. Amun's role was later thought much greater, and for a time, he became chief god, although he eventually became considered a manifestation of Ra.
For a time, Ra and Horus were identified as one another, and when the Aten monotheism was unsuccessfully introduced, it was Ra-Horus who was thought of as the Aten, and the consequent cosmogony this inspired. Later, Osiris' cult became more popular, and he became the main god, being identified as a form of Ptah. Eventually, all the gods were thought of as aspects of Osiris, Isis, Horus, or Set (who was by now a villain), indeed, Horus and Osiris had started to become thought of as the same god. Ptah eventually was identified as Osiris.