The war actually began thousands of years ago when Steppenwolf and his armies first arrived on Earth and battled against a united force of Amazons, Olympians, a Green Lantern Corps member, Atlanteans and all the tribes of Men.
It was ended in 2017 when Steppenwolf and his armies attempted to invade Earth once again and were defeated by the Justice League.
During the Earth invasion over 30,000 years ago, the mighty ruler of planet Apokolips, Darkseid, has ordered his uncle, Steppenwolf, to conquer the Earth, and he faced the united armies of Humans, Amazons and Atlanteans altogether the Olympian Gods and one Green Lantern sent by the Guardians of Oa for help defending earth against Steppenwolf.
He had used the mother boxes for transforming the Earth and murdered a Green Lantern in the process, but he was defeated by Zeus and forced into retreat, leaving the mother boxes in the process and returning to Apokolips in humiliation. He was exiled shortly after.
It is believed that he learned of Superman and his death when Luthor contacted him, and thus began the next invasion shortly after.
The Second invasion and end of Steppenwolf's exile
In the present, the world is in mourn following the death of Superman. Sensing humanity's fear, Steppenwolf and his Parademons return to Earth to resume their hunt for the Mother Boxes through kidnapping several employees of S.T.A.R. Labs, which is in possession of one of the boxes.
Steppenwolf manages to retrieve the Mother Box from Themyscira, prompting Queen Hippolyta to warn her daughter Wonder Woman. She joins Batman's group and informs him about Steppenwolf and the Mother Boxes. The two of them fail to persuade Aquaman and Cyborg, but manage to recruit Flash into the team. Cyborg later joins the group after his father Silas Stone is among those kidnapped, and Steppenwolf attacks Atlantis to retrieve the second Mother Box.
The Justice League vs. Steppenwolf
The team later receives intel from Commissioner James Gordon that the Parademons are traveling underground, and conclude that Steppenwolf's army is based in an abandoned facility. Although the group managed to rescue the kidnapped employees, the facility is flooded during combat, which traps the team until Aquaman rescues them, having decided to join them after Steppenwolf's attack on Atlantis.
Cyborg retrieves the last Mother Box from S.T.A.R. Labs for the group to analyze. Batman decides to use the Mother Box to resurrect Superman not only to help them fight Steppenwolf's army, but also to restore hope in humanity. Wonder Woman and Aquaman are hesitant about the idea, but Batman forms a secret contingency plan.
Clark Kent's body is exhumed and placed in the waters of the Kryptonian ship, and Allen provides a strong energy blast to activate the Box and resurrect Superman. Superman, however, possesses few memories, and he attacks the group after Cyborg accidentally launches a projectile at him. On the verge of being killed by Superman, Batman enacts his contingency plan: Lois Lane. Superman calms down and leaves with Lois to his family home where he reflects and tries to recover his memories.
With the last Mother Box unguarded, Steppenwolf retrieves it with ease.
The Final Battle and End of the War
Without Superman to aid them, the remaining five heroes travel to a remote location in Russia called Pozharnov, where Steppenwolf plans to unite the boxes once again and reshape the world for his lord and master.
The team fights their way through the Parademons to reach Steppenwolf, although they are unable to stage a significant enough distraction for Cyborg to separate the boxes. Superman arrives and assists Flash in evacuating the city, and ultimately aids Cyborg in separating the Mother Boxes.
Following the separation, an enraged Steppenwolf enters the Apokoliptian construct, where he is confronted by Superman, (who after battling both Wonder Woman and Aquaman), is easily overpowers the New God. The Kryptonian uses his ice breath to freeze Steppenwolf's axe, which Wonder Woman shatters the weapon with her own sword.
Bleeding and thus knowing he has been defeated, he is overwhelmed with fear, as his Parademons begin to attack him. Turning on him, he fights them as he and Parademons alike, are whisked away via Boom Tube, leaving nothing but his helmet behind.