History of Space Marine
At the end of the Age of Strife, the Emperor revealed himself as a warlord on Terra, united Terra under the banner of golden eagle and with the formidable Thunder Warriors. After allied with Machanicum on Mars, the Emperor created 20 Primarchs and with their genetic materials, he created the ultimate soldiers, Legions Astartes also know as Space Marine to conquer the galaxy and reunion the human colonies throughout the galaxy.
the warp storm take away the Primarchs, so the Emperor lead the newly-established 20 legions alone. After found his sons, the mighty Primarches, his appointed them as the leaders of their own legion and continue the conquest of the galaxy. Together, them free human worlds form xenos and tyrants, bringing millions of worlds under the banner of the double headed Eagle.
The First Chaplain of Word Bearer, Erebus used a ruse to turn Horus Lupercal into a traitor.
Loyal Legions are divided into Chapters according to the Codex Astartes written by Roboute Guilliman.
Some Legions like Space Wolves didn't approve this and organized in Great Companies
Variations of Space Marine