In 1939, Fawcett Comics was looking to capitalize on the superhero boom created by characters like Superman. The writer Bill Parker came up with the idea of a team of superheroes, each of whom possessed the power of a different mythological figure. The idea was ultimately revised to just one character with all of those powers, and thus was born Shazam.
Parker originally called him Captain Thunder, but that name was already trademarked, so he switched to Captain Marvel. (A competitor, Timely Comics, did not rebrand as Marvel Comics until 1961.) The artist C.C. Beck was the illustrator, and he continued to draw Captain Marvel throughout the 1940s.
In his first appearance, Billy is an orphaned paperboy who meets a wizard in a mysterious subway station. After learning about Billy’s sad life, the wizard declares that he is too old to keep fighting crime and asks Billy to take his place. He endows Billy with the power to turn into Captain Marvel any time he says the word “Shazam,” which is an acronym for the “immortal elders” who give him his powers: Solomon, Hercules, Atlas, Zeus, Achilles and Mercury.