Originally, the Autobots were not a faction, but the name of a peacekeeping organization; under the command of Optimus Prime, they defended Cyber City. Their headquarters was adorned with the motto "Truth - Justice - Freedom". They were unable to stop the Mini-Con-powered Decepticons from taking Cyber City, and for a million years they were reduced to a rebel organization desperately trying & failing to protect Cybertron. The reactivation of the Mini-Cons on Earth gave the Autobots an opportunity to gain Mini-Con power of their own, but eventually the Decepticons were beaten not by them, but due to the attack of Unicron.
Throughout the Unicron Trilogy, the Autobots switched motives after each major conflict. At first, they were attempting to liberate smaller robots, called Mini-Cons, from the tyrannical control of Megatron, who saw them as tools to be used and disposed of when no longer needed. The Autobots followed the Mini-Cons' ship to Earth, where they crashed and eventually continued their battle against the Decepticons.
These two sides would unite to fight the Chaos Bringer, Unicron, when he threatened to devour Cybertron. With Megatron sacrificing himself to save the rest of the Universe, Unicron shut down and was destroyed. The remaining Transformers united as the Autobots, following Megatron's order to assist them in rebuilding Cybertron.
Megatron's final orders to his troops still stood: work with the Autobots. The Decepticons maintained a degree of autonomy, still wearing the faction sigil and often taking military/defensive positions in the growing number of energon-mining colonies, but they were ultimately answerable to Optimus Prime and the Autobots. There were, of course, dissenters, most of whom were captured and imprisoned. For a decade, Autobot and Decepticon worked side-by-side in a somewhat stable truce.
Both sides found themselves the target of attacks from Unicron again; hordes of Terrorcon drones, sent by Alpha Quintesson to steal energon ore with which to revive the now-shattered husk of Unicron. What the alien did not count on was that Megatron's spark had survived within the remains, and was siphoning energon from Unicron's body. Soon the Decepticon leader had revived himself in a new form, driven off Alpha Quintesson, and, along with an elite cadre of soldiers and a seemingly inexhaustible supply of mindless Terrorcon drones, begun his new plans for conquest.
When news of Megatron's return reached Cybertron, hundreds of Decepticons rose up and rebelled, eager to get back to conquering. But having been joined to Unicron for so long apparently had given Megatron a taste of godhood; he had no more interest in amassing a galaxy-spanning army of troops. Countless Decepticons died in the resulting battles, with Megatron more than willing to sacrifice them without a thought to attain ultimate power for himself. As the "Powerlinx Battles" - as they came to be called - came to their climax, Megatron found that his actions and thoughts were being influenced and controlled by the dark spark of Unicron. Unwilling to let Unicron stand in his way, Megatron ultimately sacrificed himself (again) and seemingly destroyed Unicron's spark by plunging himself into a newly-formed energon sun created by Primus.
Another ten years after Energon, the energon sun created by Primus was gone, collapsed into the "Unicron Singularity", a giant black hole threatening to devour all of existence. In death, Unicron's power to destroy his only opposition - Primus - was greater than ever. The Autobots searched for a method of destroying the Black Hole and found a single answer; the Omega Lock, a powerful artifact linked to the Spark of Primus. With it, the Universe could be saved... or destroyed. Seeing an opportunity to rebuild existence in his own image, Megatron sought out the Omega Lock and the Cyber Planet Keys.
As the two sides battled for the Keys, the Autobots would eventually find all four and use them to revive Primus, but in doing so caused a massive earthquake that began shattering the planet around them.
Primus was emerging from Cybertron, awakened from the body he sculpted into a world for his creation. When informed of Unicron's destruction, he was infuriated to find that the universe was out of balance because of a severe lack of evil. Starscream attacked Primus's weakened form, due to the smaller robot stealing a piece of his spark and becoming an even equally huge monster, but was quickly dispatched by his creator. Defeated, Starscream flew off, leaving the Autobots to seal the Black Hole. Once this was accomplished, Galvatron attempted an escape from his fire dimension, but by combining Vector Prime's sword with the Omega Lock, the portal was sealed, and the Autobots returned home in peace.
The remaining Decepticons joined the Autobots, save for four who left Earth to start the New Decepticon Army. Their ship made it to Mars before crashing.
Read more about this topic: Autobot