Basically, after the war in which the humans managed to wipe out their entire species, beings started to rise from the remnants of the world. The first was Virginia, Queen of the gods and the Lady of War. She represented the post-magic human world, and some believe she was the sole survivor. Then there were Malik and Nuka, Malik repaired the earth while Nuka cleared the sky and created the underworld. And the gods kept popping up like that.
The gods aren’t always seen in a religious way, as some, like Colin and Dahlia, practise religions unrelated to them. They see the gods as more magical beings than witches, but not holy. (Colin is Jewish and Dahlia is Muslim, btw)
The witches powers do come from the gods however, unless someone, perhaps some Boss Person kinda like a Main Bad Guy, found a alternate way to gain power, such as from Other Witches. The witches don’t choose what powers they get, they’re naturally drawn to those things.