I'm going to write you a little story. Except it's not really a story, but an explanation of the matrix trilogy. I'm not going to delve into the interpretations or undertones of political, spiritual, or religious context, but instead give what I feel is strongly implied by the movie. I may not formally justify each of these implications, because this is not a formal paper, and people can choose to believe whatever they want. However, if you choose to believe that something I've written is wrong, then you are probably making a bad choice.
I'm not an apologist for the movie either. I thought that the first two matrix movies were awesome, and that the WBs had an obligation to give us the real answers in m3, but they chose not to. However, I was wrong. Reloaded just distracted us from the point of the trilogy. The WBs never intended to create a system for us, they just wanted to tell us a story. This story happens in a vast universe, but explaining every detail of that universe was not their goal.
One given I want everyone to accept before they start reading is that there are clues left by WBs about the actual meaning of the matrix, and everything's place. These clues may not be obvious, but they will at least make sense insofar as they are put in the movie, and seem to do very little else in terms of furthering plot or giving outright explanation about the matrix.
A long time ago, the entity we call the oracle studied human phenomenon of the senses the machines do not have access to. Those senses include at the very least taste. She was created in order to give taste to the humans inside the matrix. Think back to Mouse's conversation with neo in the neb when they eat the runny goop. The oracle studied the phenomenon of taste, and that is why she's obsessed with candy and cookies. I will not rule out the possibility that she was also implanting programs or directives via cookie/candy, but in the movie I saw no implication of this.
Through her studies with taste, she grew as a program, and actually began to appreciate the human experience. However, the architect came to her when his matrix had failed twice. The answer seemed obvious in a general way to her, the interface was not complete. It was missing something that the real world somehow gave the humans. That something, turned out to be the concept of choice. Perhaps incomplete in the minds of the humans, it must have actually existed in the real world to be causing such problems. So freedom was granted to the human population of the matrix. No longer were they simply experiencing the matrix, they were now interacting with it. The matrix did not develop into a perfect world of peace, or a world of torture (as the first and second matrices were, respectively) but instead a mixture of both with lesser extremes.
However, only 99% of the people inside the matrix accepted it, and the 1% accumulated and began to destabalize the matrix. And then, it appeared. The anomaly. Through sheer will, this anomaly was able to exert incredible forces within the matrix. The oracle contacted him/her. The oracle told the anomaly about the matrix and the world outside it. The anomaly began to wake people up. The architect, scared of another collapse, and failure of his great genius was close to pulling the plug when the oracle proposed a system of control she called 'the prophesy'. Her system would allow the architect to study the effects of the anomaly, and keep the matrix stable. The plan was for there to be a last human city, in which the 1% who rejected the matrix could live, believing in the coming of a savior to mankind, and the oracle would get the anomaly to return to the source via the architects room.
Ok, now here's where it gets a little sticky. You see, it was the oracle who created the anomaly by somehow unbalancing the equation. What equation you ask? The equation is a formula representing human choices and consequences. To the architect, it is mere cause and effect. The psuedo-physics of the matrix had to be kept in check in order for there to be stability. In other words, the equation symbolizes the 'rules' of the matrix. I really don't know how the oracle makes it unbalanced, but it results in the anomaly, and the oracle devised the system of the prophecy on the basis that it was a test for mankind, on whether or not they were ready or able to accept peace. If the One passes the test, she then would help the One take over the matrix, and force the machines to make peace. To the oracle, it was the humans supreme valuing of self-preservation that lead to the war in the first place. Only someone who could see something as a higher value than simply living could demonstrate the qualities necessary to even give peace a chance. And so we have the two doors. Through one door is the continuation of the human species, through the other is another value, probably love (as in Neo's particular case). Go through the first door, and the scenario ends, and restarts. Go through the second, and humanity is given a chance.
Alright, most of the stickiness has left us, and if you are still in one piece, then we are doing good. The merovingian, an exiled program who took his love, persephone, with him to the matrix, wants to rule there. His exact origins as well as those of persephone are shrouded in mystery, and the mythos concerning their names seems more metaphorical than revealing. What he was before he came to the matrix is not known, but he does not like the idea of the One coming in and taking away his power, and to him, humans are a lower form of life, driven by their desires alone. Of course, he is above this (sarcasm) as he proves himself reliant on humans for his own satisfaction.
Now, some speculation can be made about the merovingian. Because it is explicitly stated that he is a program, we must just accept that. His function was most likely some sort of programming, perhaps while the architect designed the matrix, the merovingian did a lot of the actual coding. It is quite likely that persephone was used to gather information about human emotion, but this is mostly speculation.
Seraph, is another enigmatic program. He is yet another exile, and apparently has a past with the merovingian. He explicitly says that he is not a programmer, that he instead protects 'that which matters most'. What matters most are the 'Eyes of the Oracle'. I'm not sure exactly what that is, but I believe it is whatever part of the Oracle's programming allows her to see the future. I believe that seraph was employed by merovingian for protection after he was exiled, and he was probably even written by the Merovingian himself. However, it would seem as though the Oracle probably re-wrote part of him, and 'stole' him from Merv. So he's not happy about that. He tells them to get what Seraph is protecting, and you can see the frustrated look on Seraph's face.
Back to the prophecy. Normally, when the One fails, the whole thing starts over. And things repeat themselves pretty much in the same fashion, but something happened differently during neo's transformation into the One. The first thing that happened differently is that neo died. He was killed by Smith, and the only reason why is because of Cypher's betrayal from before. Neo then got up and killed smith. When he did, part of the anomaly was copied onto smith, and smith became some sort of nemesis anomaly. His ability to copy is a sort of expansion on the former agents ability to enter any person still plugged into the matrix. Now he doesn't just enter them, he copies onto them, and any other agents, or programs, or zionists that are so unlucky to cross his path.
Smith gives clues that his own transformation is one of the only, if not THE only difference in this prophetic cycle when he tells himself "It's happening exactly as before. Well, not exactly." Later, smith knows where neo is going on several occasions, and even arrives at the entrance to the source before neo. Unfortunately for him, he has no keys to the source.