Once upon a time, Seth Adam was living in Egypt and son of Pharoa Ramses the II, ruler of the fictional land of Kahndaq. He was so virtuous and heroic that the wizard Shazam gave him the powers of all of the Egyptian gods.
For some reason (I haven’t actually read those issues), Shazam’s half-demon daughter Blaze wanted to screw with Black Adam (probably because she’s half demon and also because her dad gave his legacy to a perfect stranger). So she fixed it so that when Seth Adam said “Shazam” to activate his power, he’d be the avatar of the bad Egyptian gods and not the benevolent ones.
Thanks to Blaze’s dick move, Shazam became a bad guy instead of a good guy and got the name “Black Adam”. But that’s Fawcett Comics Black Adam from way back in 1945. Apparently DC revamped with a more positive back story. I still haven’t read Black Adam #1 yet. I’m going to get to it.