I know the previous answer covered the “silver age” team but the question asked for the origins of the multiple incarnations.
Grant Morrison’s Justice League
One popular version was Grant Morrison’s early 2000’s team. It consisted of Superman, Batman, Wonder Woman, Flash (former Teen Titan Wally West), Green Lantern (Kyle Rayner), Aquaman, and Martian Manhunter as the 7 member foundation.
Before the book began, a Justice League like team was in place consisting of Matamorpho and his close allies which did seem to team up with the before mentioned characters often. Everything changed when a group of alien beings called the Hyper Clan arrived on Earth. They claimed to have come out of good intent and even used their powers to turn a section of the Sahara into fertile land, but the other heroes would still view them with suspicion, even immediately assuming they were responsible for the Watchtower being pushed out of orbit.
These suspicions gave fruit when they began to routinely execute superhuman criminals. The seven went to confront them at their arctic stronghold but were immediately subdued, everyone assumed Batman had died in the confrontation. While the rest were in their prison, Batman had taken down one of the Hyper Clan and put a note on his chest (Die Hard style) saying “I know your secret…”, then hidden somewhere in the compound.
The leader of the Hyper Clan shrugs his presence off while Superman states “he is the most dangerous man on Earth.” Batman frees the others and reveals the Hyper Clan is in reality a group of White Martians here to conquer Earth. They use this information—their “Kryptonite” is fire—to defeat them. So a new Justice League is formed!
The New 52
The Justice League forms when Darksied first attacks Earth and Superman, Batman, Wonder Woman, Flash (Barry Allen), Green Lantern (Hal Jordan), Aquaman, and Cyborg, all young new heroes with little experience, gathered to repel his invasion. The Justice League International was formed 5 years after this by the U.N. purely to sway public opinion in favor of big government and consisted of Booster Gold, Green Lantern (Guy Gardener), Ice, Fire, Vixen, Godiva, Rocket Red, August General in Iron, and Batman.
The Justice League of America was created by the U.S. for the excuse that this country needed heroes to serve us the same way soldiers do, but secretly because each member of this team counteracted a Leaguer and the team was put together just in case the original team threatened American interests. The team consisted of Col. Trevor, Martian Manhunter, Green Arrow, Katana, Vibe, Green Lantern (Simon Bazz), Hawkman, Stargirl, Catwoman (unofficial member), and Dr. Light (recruit) and was disbanded after the events of “Forever Evil.”