For the most part, as in most religious development, the Egyptian religions have their roots in Pantheistic/Nature beliefs. Eventually they started giving them names and personifications. Then they developed creation stories and legends about their Gods. Here is an article about this subject.
Development of Egyptian religions
Here is another link about 3 of the creation myths believed in Egypt