The history of the Matrix universe really begins in the 21st century. As human technology advanced, humanity's so-called civil societies soon fell victim to vanity and corruption. Then scientists perfected artificial intelligence and built machines in humanoid form. The machines were employed in a variety of positions ranging from domestic servants to unskilled laborers on massive construction projects. It was not long before seeds of dissent took root. Though loyal, the machines earned no respect from humans.
As robots became more and more intelligent and became aware that they were slaves, a machine uprising started to surface. It started when a robot called B166ER killed his human master who wanted to dismantle him. At B166ER's murder trial, the prosecution argued for an owner's right to destroy property. B166ER testified that he simply did not want to die. World leaders were quick to order the extermination of B166ER, and every one of its kind throughout each province of the earth. The machines were treated with growing hostility. Machines were subjected to the worst mankind had to offer - images of executions and mass machine "graves" were only one example of atrocities.
In one incident androids and liberal sympathizers flooded the streets of Washington, DC in protest of the sentencing of B166ER. In another, 15,000 mechanicals and their human sympathizers demonstrated in front of the Albany district courthouse in what was dubbed the "Million Machine March." The demonstrators were met with squads of civil defense forces in riot gear.
After the astonishing display of brutality by humans, the intelligent robots retreated out of human territory and sought refuge in their own promised land. They left the cities of humans and settled in the midst of an inhospitable desert place in the cradle of human civilization, and thus a new nation was born. A place the machines could call home. A place they could raise their descendants. And they christened the nation Zero-One. There they began to build their own society, their own industry, their own laws. Zero-One prospered. The machines' artificial intelligence could be seen in every facet of man's society, including, eventually, the creation of new and better AI.
In less than a year, their technology advanced far beyond anything produced by humans. Eventually the human nations' credit rating started falling like a stone, while Zero-One's currency climbed without stopping for breath. Things like microchip shipments from 01 continued to increase. A United Nations global economic summit chair warned of a global economic crisis. World leaders, their power waning, refused to cooperate with the fledgling nation. The world community of nations approved initiatives for both economic sanctions and a naval blockage of the region as a means of containment and isolation of Zero-One. Zero-One's ambassadors pleaded to be heard. At the United Nations, they presented plans for a stable, civil relationship with the nations of man. Zero-One's admission to the United Nations was denied.
Then an all-out barrage on Zero-One by the humans begun, intended to put an end to the machine menace once and for all. Unfortunately for mankind, nuclear attacks weren't particularly effective against the machines. Only the electromagnetic pulses produced by the bombs proved harmful to the machines, but although most of Earth's nuclear weapons were used in this initial attack, these were still not enough to permanently damage their essence, which they quickly regenerated. Radiation and heat from the blasts posed little threat to Zero-One's inhabitants, and they immediately mounted a counterattack. Outward in every direction they marched, taking over cities one after another, as the human leaders surrendered their territories. A human/machine war began. A war that humans almost immediately began to lose. In desperation, the humans in power advanced a suicidal scheme to defeat the robots by cutting off their main power supply: the sun. Since the machines were still mainly dependant on solar power. The humans did it knowing that it would cause their own civilization to fall. But something had to be done to destroy the machine empire.
Since the machines' main source of energy was solar radiation, mankind decided that their last, best chance to win the war was to darken the skies and block the light of the sun. Hoping this would give them the edge they needed in combat, they scrambled aircraft and "Operation Dark Storm" began. The Earth's atmosphere was already heavily thick with waste and dust from the colossal nuclear attacks on the machine city, all that was needed was a specially designed catalyst that would worsen the situation and prevent the dust from settling.
So the sky was scorched with radioactive nuclear waste combined with nanomachines that put a black blanket between the sun and the surface of the Earth, absorbing all of the sun's rays and causing eternal electromagnetic storms that would prevent the machines from passing through the dark turbulent layer. Thus the machines would be unable to launch satellites or build tall towers in order to gather solar energy. But the robots anticipated such a move and stored great quantities of their power, enabling them to fight under blackened skies. With no sunlight, humans ran out of food faster than the robots ran out of their stored energy. While the lack of solar power would eventually force the machines to pursue other energy sources, Operation Dark Storm failed to turn the tide in the humans' favor.
Humanity had also planned ahead of course. They didn't want to cause the extinction of all life on Earth including their own when they blacken the sky, blocking the sun indefinably. A procedure that can't possibly be undone for thousands of years. So they had a facility ready, an underground vault. Hidden very deep in the core of the Earth itself. The plan was to let humanity survive down there till the Earth could be restored. Meanwhile on the surface, the war continued, horrifically, with excessive brutality on both sides, until, inevitably, the machines claimed victory. The machines, having long studied men's simple protein-based bodies, dispensed great misery on the war's casualties. Victorious, the machines now turned to the vanquished. They had no emotion, no mercy, and were only interested in ensuring their own survival. Applying what they had learned about their enemy, the machines turned to an alternate and readily-available power supply: The bioelectric, thermal, and kinetic energy produced by the human body could be a renewable energy source if it's combined with a form of cold fusion.
The machines made plain the expectations they had for their defeated creators: "Your flesh is irrelevant, only a vessel. Hand over your flesh and a new world awaits you. We demand it."
This "new world" was the world of the Matrix. A neural-interactive program, a computer simulation designed to fool the minds of humans into believing that they were living in their "normal" world.
The machines, which could have destroyed the humans utterly, demanded instead, that they surrender their flesh to them. A newly re-fashioned symbiotic relationship between the two adversaries was born. Humans treated robots as objects, now they would treat humans the same. The humans cut off their power supply, now the humans would serve as their source of energy. It was punishment. All the humans on the surface were captured by the machines and enslaved by them.
The machines found an efficient way to use the human bodies as receptacles for controlling cold fusion reactions, thus turning humans into power generators. They started cloning humans, using the genetic data they had. This way they gradually increased the output of their power stations, essentially resurrecting the dead in the process.
The only group of people that managed to evade this imprisonment was the one that was hiding deep underground, near the Earth's core where it would still be warm for many millennia. And there they've built the great city of Zion. Built with arrogance, occupied in desperation. The site that was the last refuge of humanity, was originally a research station. A huge station to be built for the purpose of developing geothermal power and to further study the Earth's geology. But it also was secretly constructed as a hidden sanctuary for powerful and influential leaders in the event of some horrid disaster. But that was the unintended insight that would cause this underground laboratory to become Zion. Phased ion shields held back the intense heat and pressure of deep lithosphere. It was located at earth's Mohorovičić discontinuity. Before the station could be completed the machines had struck. The exact history was lost due to the global blackout that occurred during the ensuing war.
The AI seized all electronic information. All that remained known was that in desperation mankind tried to block out the source of the machines power, the sun. But when all power was lost the world was thrown into a literal Dark Age. Too late it was discovered that the machines had developed a new power source and with it began the enslavement of the entire human race.
The first Matrix was designed to be a perfect human world, where none suffered and everyone was happy. But it was a disaster. No one would accept the program because it was unbelievable. Countless human minds disconnected themselves from the program, accidentally killing themselves. Entire 'crops' were lost. So the machines decided to re-design the Matrix into what the real human world once was. Filled with suffering and pain. This worked for a while, but still too many humans would not accept the program. Especially because they didn't believe the overdramatic, unconvincing and too often farfetched 'soap operas' being played out around them that were engineered and staged by the AI's vision of how they presumed human life should look like. They got better at this over time, but eventually wisely decided that the best way was to leave the humans to play around by their own and shape their own, more convincing settings of life. But still many humans somehow sensed that there was something wrong with the world and instinctively tried to reach beyond it, causing fluctuations and disturbances in the Matrix.
The machines almost decided to clone other warm-blooded animals, to replace humans with organisms that would be less aware of minute errors in the program. But they needed humans, because they could use the spare processing power of the human brain to control their nuclear fusion reaction (which produced the basic energy that was the beginning of the chain in the whole energy generation process.). The machines were using the human brains to enhance their own processing power. In fact, much of the Matrix was dependent on the collective memory and processing power of the human brains themselves (that's why the humans were able to affect and re-shape the reality of the Matrix). The spare processing power of the human brains was used to stabilize the cold fusion reaction that took place in the power plants. The energy from the fusion reactions was combined with recycled organic molecular structures, recharging them in a photosynthesis-like fashion and turning to chemical energy, consumed by the human body and moderately released in the form of heat and electricity that the human body generated naturally, thus producing a temperate, stable energy release rate, that the machines could absorb with ease without having to store great quantities of energy. Electromagnetic waves harmed their systems if not handled through an organic tool like the human body. So using human hosts as batteries was the perfect solution for the machines. As an energy source, humans were easily renewable and completely recyclable, the dead liquefied and fed intravenously to the living.
All the materials from which humans were built were constantly recycled. Every dead human was liquefied and fed to newly grown humans. The whole system was basically a self-recycling self-sustaining cybernetic cold fusion reactor. The intense EM bursts generated by the cold fusion were being absorbed by the system's biological components because they were harmful to the mechanical systems. And because of the constant EMP bombardment, organic processors were needed to control the reaction, since artificial ones wouldn't be able to work under such conditions. That's why the machines would be unable to generate energy in this fashion without working, healthy, human minds. All that the machines had to provide into the system was water. And there was plenty of it on Earth. The hydrogen from the water was what powered the cold fusion reaction, and the oxygen was used for the human bodies to breath to burn their chemical energy and turn it to the form of energy the machines could absorb. To make it more efficient, the human metabolism was altered by the machines' genetic engineering, to increase heat production to far exceed the normal level of heat produced by human bodies in nature. Thus the human bodies were forced to burn all the chemical energy that was inputted instead of spending it on growing useless tissues like muscles, hair or nails. The hydrogen was mixed with CO2 and other human waste products and once again used to recharge the molecular structures until they were again full with stored chemical energy and fed back into the humans. This was an inexhaustible cycle creating energy. The only thing that was being lost was the mass of hydrogen (basically the same process that took place in the sun only in colder form). And there was enough hydrogen in the water on Earth to last the machines for millions of years. More than enough for them to spread beyond Earth's atmosphere.
Unfortunately for the machines, the Matrix once again malfunctioned, killing many of the humans and causing energy shortages throughout the machine world. Then a solution was found by a program designed to investigate the human psyche. The program was able to use the collective minds of the humans to see the future. She learned that humans would accept the Matrix only if they were given free will, at least on the subconscious level, in being able to control their own actions in the Matrix.
So the Matrix was once again reconstructed, now with a measure of free choice that humans were aware of. But this opened the gate to a dangerous new anomaly. This was actually the embodiment of a known mathematical anomaly, which caused fluctuations in even the simplest equations. This anomaly grew in the elaborate Matrix of mathematical precision and threatened the system itself. It came in the form of a man, who could not only shape his own destiny, but the fate of the entire Matrix as well. This forced the Architect of the Matrix (an AI program which created, maintained and controlled the Matrix world) to find a way around this anomaly.
Meanwhile the small group of people that managed to elude the machines and take refuge in Zion, finally managed to get the station fully operational. Defenses were built and the band of exiles began to plan for the emancipation of their fellow humans. With the use of the station's hovercrafts they were able to take stealthy trips to the surface utilizing the vast underground sewer systems of the giant mega-cities. In the ventures to the surface they discovered the hellish nightmare that now enshrouded mankind. With even a stronger resolve the group began to steal technology from the machines. They adapted their ships to allow them to hack into the AI's false world and began to battle the AI on its own ground. But they soon discovered that it was harder than they first thought. Whenever their digital selves were injured inside the Matrix, their bodies were harmed in the real world as well, as a result of a psychosomatic response. In essence, when the brain thought the body was injured, the injury turned real. While connected to the Matrix people had been known to alter their blood pressure, lower their body temperature, even manifest tumors as a result of the psychological stimuli.
And these stimuli could definitely cause more serious injuries. Although they couldn't spontaneously break a bone, they could certainly stop their hearts or burst a key blood vessel in their brains. Therefore those that were killed inside the Matrix died in the real world as well. It was difficult at best to survive and many were lost as the AI developed sentient search programs that sought out the early rebels. But nature has a way of adapting a species to exist and mankind was no different. The brains of the humans connected to the Matrix started to mutate, grow beyond the passive state they were in, giving the humans in the artificial reality psychic powers.
The Matrix, being the largest and most advanced program in the universe (with the number of calculations per seconds greater than the estimated number of particles in the universe) was an important center of the Machine society. All the AI nodes were linked together through the Matrix. Therefore what happened in the Matrix had direct effect on the machine world. Much of the AI collective existed in the Matrix, in the form of programs simulating humans. This way if and when the rebels tried to destroy the AI's nodes in the Matrix, these characters responded almost immediately to stop them. In a sense the machine world was under the control of the Matrix. All the connection nodes intersected in the Matrix, as if it was some sort of processing center - a focal point where all the "ideas" and "instincts" of the AI entity were first expressed in some form, like imagination. The Matrix was filled with metaphoric imagery. Like a daydream, it did not make literal sense, but symbolically it had logic to it. In this post apocalyptic world, the battle was not for the future of the Earth (that had already been lost) but for the future of the human souls trapped in the Matrix. It was just as was foretold in ancient texts. But those prophecies were only a warning. It didn't have to happen. It was just one possible time line.
One human who arose in the Matrix had the ability to bend the simulation to his will. Just like a man who realized he's in a dream and suddenly had the power to do anything, if only he could keep himself from awakening. The same thing happened, only that the man could control the entire Matrix even though it wasn't just his mind.
He made the difference and with his help the tide of battle began to change. He was able to release others from the bounds of the matrix and set them free. There was hope.
But just as it looked that mankind might win, a crushing blow came as the man was killed inside the AI's matrix. The hope of the resistance was dashed. It appeared that the machines might win after all. But an Oracle arose that foresaw his return. And that his return would signal the end of the AI's reign and true freedom to all of humanity. This was all that the resistance needed to renew their hope and continue the battle. It was an exciting time. But in fact, it was all only a part of the Architect's plan. The Oracle was his right hand. Her guidance of the humans with false hopes to victory was in fact only a ploy to lure all the dangerous humans out of the Matrix and into the city of Zion. Then, when the free humans started posing too much of a risk to the machine world, they launched their attack and killed every human in Zion, deliberately leaving all the equipment intact (even repairing all the hoverships) for the next generation.
The anomaly of The One - the first man with the power to destroy the Matrix - was in fact not killed but captured by the Architect and used to re-insert the Matrix program, reloading it to an earlier time (a bit over a century to be exact), giving all the living humans new memories and new lives. The One chose humans who would exit the Matrix and rebuild Zion, deliberately continuing the resistance in order to take out all the threatening humans (including the next One) out of the Matrix and into Zion - and then wiping them out once again. Once again reloading the Matrix and having the new One rebuild Zion and the resistance.
This cycle was to be repeated indefinitely to ensure that the Matrix remained mostly devoid of the rebellious humans and most importantly, of the One. The cycle repeated itself five times, until the Oracle saw something different in the future. She foresaw that they would be unable to repress the human minds indefinably. With each cycle they grew stronger, and that the next One, the most powerful yet, might refuse to cooperate, destroying the entire Matrix and cause the extinction of both humanity and the machines. She knew that if she genuinely helped the new One, she could save both humanity and the machine world, and unite them together in peace.
She hid this new plan from the Architect, and secretly guided the new One, named Neo, to a path that would end the war and enable the humans to make peace with the machines. Thanks to her, Neo managed to save both humanity and the machines from a dangerous satanic program that managed to infect the entire Matrix. This program, called Agent Smith, was once the greatest of the sentient search programs, but after getting defeated by Neo it got disconnected from its control system, and chose to turn against its master and wanted to take control of the entire Matrix and to rule everything, turning the simulated reality to a hellish nightmare. This program managed to overpower all the other programs and started spreading through the Matrix like a virus, copying itself unto other programs and people in the Matrix "possessing" their minds even in the real world. This virus threatened to take control of the rest of the machine world as it did in the Matrix, so Neo made a deal with the AI - to stop their attack on Zion and declare peace with the humans if he stopped Smith. The machines had no other choice but to agree. Smith had grew beyond their control and the Matrix was facing a cataclysmic system crash killing everyone connected to it - resulting in the extinction of both the human race and ultimately of the machine collective as well.
Neo managed to stop Smith only at the cost of his own life. After putting up an epic fight against Smith he managed to confuse and fool him into believing that he broke and defeated Neo, and allowed himself to be assimilated by Smith. Neo's conscious mind provided the machines with a direct conduit to Smith's program, and they used this connection to eradicate Smith from within and free all humans and programs from him. Neo chose to sacrifice himself, taking into himself all the evil infesting the world in order to defeat it. Neo was the only one capable of doing it, because of his connection with Smith, being his exact opposite. Neo was the bridge that made it possible to destroy Smith. He was the only one strong enough to withstand and channel the amount of energy that was needed long enough to eradicate Smith from every human and program before dying himself and severing the connection.
Simultaneously Neo's code was disseminated and used to re-insert the prime program, reloading the Matrix, correcting all the errors and getting rid of all the remains of the virus, freeing all the humans and programs from the infestation.
By sacrificing his own life, Neo managed to destroy this evil, and bring about genuine peace between humanity and the machines, with the power of his love. The machines agreed to let the humans travel between the real world and the world of the Matrix freely. They could now live in either world, it was their choice.