The film opens with a young couple sitting in their car on a hillside outside of the city as an apparent meteor streaks across the sky and smashes into the couple's car. It is revealed that that meteorite is actually Black Adam, returning to Earth after a long exile. The film then cuts to young Billy Batson living in a rundown slum, with very little food and rats for pets. He gets out of bed wearing a t-shirt with the Superman crest. He goes to the kitchen to find food, but discovers he only has potato chips, which he ends up feeding to the rats.
On his way to meet with Clark Kent in a nearby diner, he sees some bullies mugging a homeless man. After attempting to defend the man, Billy himself receives a black eye. The homeless man thanks Billy for his intervention, calling him "The Captain". Billy tells him that he always tries to do the right thing. Billy gives him the only thing of value he has â a subway token.
At the diner, Clark buys the boy three breakfasts, and tells him he wants to write a story to bring his plight, and those in his same situation, to public light. He tells Mr. Kent that he tries to be good no matter what. As the conversation continues, neither notice that Black Adam has appeared, hovering outside the diner. He claps his hands together, blowing a hole in the side of the diner. Clark attempts to protect the boy, but a blow from Black Adam sends him through several walls. He emerges from beneath the rubble and quickly changes into Superman. Adam stalks young Billy through the streets stating his surprise over the Wizard's choice to become the next Marvel, but Billy does not know what he means. Black Adam picks up a fire engine to smash Billy, but Superman intervenes and blocks the blow. While Billy makes good his escape, Superman gets a blast of electricity from Black Adam. After recovering he realizes Adam's powers are magically based, and he is vulnerable. This vulnerability puts Superman and Adam at an equal footing. Black Adam uses magic to his advantage, but Superman responds with powers the magical being doesn't have â i.e. heat vision. After briefly getting Superman out of the way, Black Adam continues his pursuit of Billy, who runs into the subway, again encountering the homeless man he helped earlier. The man gives him a subway token, telling him he would be paid back. Billy runs out onto the tracks, with Black Adam still in pursuit. Billy is caught on the tracks when a train apparently runs Billy over, causing Adam to leave. Billy awakens to find he is on an empty subway car. The token begins to glow and he begins to crackle with lightning. In the lightning, Billy sees flashes of his life, including his parents' headstone, the orphanage, and his foster parents who throw him out, leaving him on the streets.
He gets off of the subway car at the next stop, but finds himself in a gigantic cave with statues of the Seven Deadly Sins. Billy finds his way to the Wizard Shazam who tells the boy that he is the next Chosen One. He explains that Black Adam had been his champion 5000 years ago, but Teth-Adam had used his power for personal gain and corrupted the gift. He was then banished to the farthest star in the sky, and now Black Adam has returned seeking vengeance. The Wizard then causes a cave in, telling him that he wishes to atone for the mistake of creating Black Adam, but tells Billy that should he need him, he has only to speak the Wizard's name. Billy narrowly escapes the cave as it collapses.
Outside, the battle rages between Superman and Black Adam. Superman is barely able to hold his own against the magic used. Superman is again knocked unconscious. Billy confronts Black Adam and defiantly tells Adam to leave Superman alone. He tries to hit an amused Black Adam. Billy anxiously shouts "I need a little help here, Shazam", which transforms Billy into Captain Marvel. He quickly counters Adam's attacks with his newfound abilities. Billy has only a few minutes to discover his powers; i.e. speed, strength and flight. He also discovers that randomly saying the Wizard's name takes the powers away just as quickly.
A recovered Superman is unsure of what to make of this new superhuman, but they soon discover they are on the same side. Black Adam resorts to destroying a dam which threatens to flood Fawcett City. Landing, Black Adam stops a passing car, removing its female driver to hold as a hostage. He tells Billy he must surrender himself in his mortal form, and he will release the woman. Billy complies, and Black Adam throws the hostage into the sky. But before Billy can say his magic word, Black Adam covers his mouth to silence him. From out of nowhere, Adam is blasted by Superman's heat vision. He stopped the potential flooding after quickly freezing the water with his super cold breath. Superman and Black Adam begin fighting again, but Billy is now able to utter the magic word. Adam is beaten by Marvel who stomps him into a crater in the street. Superman talks the Captain out of murdering Adam to prevent further acts of evil. Adam declares that only death will stop him. The homeless man appears once again and reveals himself to be the boy's guardian angel Tawky Tawny. Tawky reverts to his true form as a tiger and tells Superman and Captain Marvel that he will make sure the Wizard will send Black Adam far across the universe this time; it will take ten thousand years to return.
To keep from being banished even farther from Earth, Black Adam shouts "Shazam" which turns him back into the mortal Teth-Adam, whose body has aged during the thousands years he has been gone. He turns to dust in front of the two superheroes. It was an apparent bluff, as Tawny admits the Wizard is indeed dead.
As Tawny walks away, Superman looks at Captain Marvel and says "You have some unusual friends."
Billy finds himself encountering the bullies again in the alley as before. The bullies push Billy against a wall, and defiantly dare him to talk back; daring him to say "...just one word." To which, it is implied through the appearance of lightning, Billy replies "Shazam...".
As Tawny walks away, what does Superman say to Captain Marvel?
You have some unusual friends