Neo is a machine, kinda. He is a human with enhanced genetics, enhanced implants, and a machine programmed mind (probably based on a "The One" template program). That's why, at the end of Revolutions, when his body is being taken away, he is shown as an orange glow. The orange glow is how the machines see each other, and therefore how they see Neo. It is also how Neo sees Smith inside Bane... he is seeing the machine program of Smith inside Bane's mind, and therefore it is an orange glow in the shape of the Smith.
But the orange glow isn't the only reason to believe Neo is a machine. Throughout the trilogy other hints are given, such as: "His neural kinetics are way above normal.", "He's a machine.", "Your five predecessors were by design based on a similar predication...", etc.
So if Neo is a machine, why was he created (as all machines must have a purpose)? He was created by the Oracle and the Architect to be The One. As the Architect explains to him: "Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the Matrix... Your five predecessors were by design based on a similar predication, a contingent affirmation that was meant to create a profound attachment to the rest of your species, facilitating the function of The One... The function of The One is now to return to the Source, allowing a temporary dissemination of the code you carry, reinserting the prime program."
Translated, the Architect is explaining that Neo was designed to be a religious figure to the freed humans, thus causing them to put their faith (hope) in Neo and to rally around him ("...sum of a remainder..."). This helps to ensure that the freed humans are focused on Neo instead of war, and to keep them all together in one place, Zion (which was built by the machines for this purpose also). Neo is a form of control in the real world.
And just to make sure that Neo carries out his part of their plan, the machines programmed him with "... a contingent affirmation that was meant to create a profound attachment to the [humans]." This, along with his enhanced abilities and the "guidance" of the Oracle, keeps him on the intended course.
The Architect also states that "The function of The One is now to return to the Source, allowing a temporary dissemination of the code you carry, reinserting the prime program." This simply means that The One program in Neo's mind is the most important (prime) program in the Matrix, and that now that his mission (purpose) is complete, he must return to the source for deletion (all machines must have a purpose). The phrase "... temporary dissemination..." means that the The One program will be used again in the next version of the Matrix. This is also why Neo's choice of the left door will destroy the Matrix, as there can be only one The One in the Matrix at any time. By staying in the Matrix Neo is preventing it from being reloaded, as a reload will do nothing without another The One for the next version. (In programming terms he is the highest priority task, and he will not release the Matrix program's main semaphore.)
OK, so The One is a human with enhanced genetics, enhanced implants, and a machine programmed mind, and was created by the Oracle and the Architect to carry out a specific purpose (form of control in and out of the Matrix) in each iteration of the Matrix. Now let's see how The One fits in with the entire story of the trilogy.
As is explained, the Matrix was created by the Architect, at the end of the war with the humans, as a way to control the humans and use them as a power source (I know, hard to believe...). The first Matrix was "... quite naturally perfect, it was a work of art, flawless, sublime.", while the second Matrix was redesigned "... to more accurately reflect the varying grotesqueries of your nature." Basically Heaven and then Hell. In both cases, however, no conscious choice was given to the humans as to whether or not they wanted to believe in the reality of the Matrix. This caused the majority of humans to reject the Matrix and die ("... whole crops were lost.").
To solve this problem the Oracle was created, and realized correctly that the humans needed to be given a choice: "Thus, the answer was stumbled upon by another, an intuitive program, initially created to investigate certain aspects of the human psyche... she stumbled upon a solution whereby nearly 99.9% of all test subjects accepted the program, as long as they were given a choice, even if they were only aware of the choice at a near unconscious level." So by giving humans a choice, even at an unconscious level that only 0.1% are ever aware of, they accepted the Matrix.
Unfortunately for the machines, however, a majority of the 0.1% who were aware of the choice usually chose the real world over the Matrix. "While this answer functioned, it was obviously fundamentally flawed, thus creating the otherwise contradictory systemic anomaly, that if left unchecked might threaten the system itself. Ergo, those that refused the program, while a minority, if unchecked, would constitute an escalating probability of disaster." The machines therefore also needed a way to control the 0.1% of the humans who chose the real world over the Matrix, thus Zion and The One were created.
As was explained earlier, Zion was built by the machines to ensure that the freed humans would all gather in one place, and The One was created to be their religious figure, helping to distract them from renewed war with the machines. Both forms of control.
But even with Zion and The One, the unpredictability of choice ("systemic anomoly") still forced the machines to occasionally "reload" the Matrix. This always occurs when The One reaches the Source, which he can only do after attaining the level of power necessary for him to defeat the Merovingian, obtain the Keymaker, etc. The One program is then temporarily reinserted into the Source (machine mainframe), in preparation for the next iteration of the Matrix. In the process the machines gain the knowledge and experiences of The One, allowing them to better predict the future behavior of the humans, and thus reduce the systemic anomolies.
So that is the situation at the start of the sixth iteration of the choice-Matrix. Luckily for the humans, however, the Oracle does not want them to be enslaved in the Matrix any longer, or for the freed humans to be killed. She therefore decides to take a risk and use Neo to bring about a "revolution".
In M1 (The Matrix) she meets with The One, Neo, as she has done in the five previous iterations of the Matrix. Normally she simply helps guide The One to his meeting with the Architect. Except this time the Oracle gives Neo a special cookie, which he eats. The cookie isn't actually a cookie, though, it's an upgrade to Neo's program. Since the Oracle created the The One program, she can predict exactly what Neo will do in the future, specifically how he will destroy Smith (from the inside, with some copying from Neo to Smith occuring). She therefore includes in the program upgrade code that will give Smith the ability to replicate himself, and for Neo and Smith to see the future as she does.
In M2 (The Matrix Reloaded) Neo plays out his role as The One, meeting with the Architect. However, due to his love for Trinity he chooses the left door, preventing the Matrix from reloading. This was seen in advance by the Oracle, as she has the ability to predict Neo's behavior (as explained above) as well as human behavior in general (due to the nature of her program). She therefore told Trinity that she would fall in love with Neo (in M1), all the while knowing it would eventually cause Neo to choose the left door.
In M3 (The Matrix Revolutions) the Oracle's plan comes to fruition. While the machines begin their assualt on Zion (for the sixth time), Smith continues to replicate himself throughout the Matrix. Neo, on the otherhand, is stuck in the train station. Apparently, fulfilling his mission to meet with the Architect unlocks some section of his program that allows Neo to use his enhanced implants to once again become part of the machine collective (perhaps because of the Oracle's upgrade?). He is therefore able to sense and control other machines wirelessly. The first example of this is when he stops the sentinels at the end of M2. Since he is not quite ready to use his new abilities, however, his program gets stuck at the security checkpoint of the Matrix, the train station.
continued..
In the train station Neo meets with Rama Kandra, his wife, and their daughter Sati. Rama and his wife are both machines from the real world who can jack into the Matrix, like all other machines, and live human lives. Sati is a program created by these two machines out of love, which Rama explains to Neo is not out of the grasp of the machines. They are on their way back into the Matrix to leave Sati with the Oracle for safe keeping, as any program without a purpose is deleted.
After being rescued from the train station by Trinity, Morpheus, and Seraph, Neo is helped out of the Matrix using the standard jack. While aboard the Hammer he has another vision of the future, this time of the three power lines leading from the Matrix power station to 01, the machine city (he is able to see the power lines due to his newfound connection to the machine collective). He therefore takes the Logos, along with Trinity, and leaves for 01. Along the way he confronts the stowaway Bane (who has the Smith program inside of him), and is blinded by him. Although blind, Neo is still able to see other machines (orange glow), including the Smith program inside Bane, which he uses to defeat Bane. He also uses his power to control other machines to detonate the bombs fired at the Logos by the 01 defenses.
Meanwhile Smith is replicating out of control in the Matrix, and eventually confronts the Oracle after taking over Seraph and Sati. They have a brief conversation in which he calls her "Mom", referring to the fact that she helped to create him (along with the Architect) as well as Neo (part of his program now). The Oracle then tells Smith to "Do what you came here to do.", so he takes over her as well. The newly formed Smith then stands up and laughs hysterically, foreshadowing the events at the end of the movie.
Eventually the Logos crashes in 01, but not before Neo gets a top-down view of the orange glowing city with his newfound machine-vision (notice the fractal patterns). Unfortunately Trinity is killed in the crash, and explains to Neo that both of them have been living on borrowed time. Neo since he was ressurected by Trinity, and Trinity since she was ressurected by Neo. Both are meant to die and Trinity is simply happy for the oportunity this time to tell Neo how she feels about him. (But shame on the brothers for killing off Trinity in such a lame way. Couldn't she have at least died trying to save the ship, not just letting it crash!)
Neo then leaves the Logos and enters the machine building into which it crashed (the building is seen in the same orange glowing machine-vision). He is then confronted by the Deus Ex Machina, who knows that Neo is the only one who can stop Smith from destroying the Matrix, but still shows hatred toward Neo (due to the fact that he is mostly human). After a show of force, the Deus Ex Machina agrees to peace with the humans in exchange for Neo's promise to destroy Smith. This causes the sentinels to halt their attack on the Zion temple, the last holdout of the remaining humans (the dock and city have already been destroyed).
The machines then jack Neo into the Matrix, since he has not yet masterred the ability to do so wirelessly (this theme of Neo having to learn to use his new abilities runs throughout the trilogy). Neo then confronts Smith, who says he has seen the future, and that he (the one particular Smith) is the one that defeats Neo. The other Smiths (all of the other people in the Matrix have now been taken over by him) therefore only watch as the fight begins.
After a brutal battle Neo is near defeat, but continues to fight. When asked why he does so, Neo responds "Because I choose to.", echoing the theme in M2 that "Everything begins with choice." (the only way humans achieve true freedom). But even though he delivers a stunning punch to Smith which sends him through the ground, Neo is eventually defeated. Before Smith takes him over he pauses, however, realizing that he has seen this very moment in his visions, and he already knows what he is going to say. "Everything that has a beginning has an end..." he mutters confusedly. This causes Neo to realize that the Oracle still exists somewhere inside of Smith, and that she is partially able to control his thoughts. Taking his cue from the Oracle, Neo freely gives himself to Smith.
Thus Neo is defeated, and Smith's original purpose, to defeat The One (which he is never really expected to achieve, which leads to his bad temperment) is accomplished. Smith therefore no longer has a purpose and must be deleted. But since programs marked for deletion must return to the source, how is Smith to be deleted? Simple, the machines send the command through Neo, into Smith, using a burst of energy. This causes all of the Smith clones, and the original Smith, to be deleted, leaving the original inhabitants of the bodies he has taken over (this is a basic function of the agent programs, that they leave their hosts as they found them, with death being the only exception).
This then completes another revolution in the Matrix cycle, as The One has reached the Source and has reinserted the prime program (Neo's program, his knowledge and experiences). The Matrix is then reloaded back to it's initial state, the late 20th century.
The Oracle then meets with Sati, Seraph, and the Architect in a park outside the city as the sun rises over it. The Architect tells her that she was playing a "very risky game", and she asks him if he will honor the promise of peace. He says that he will, since he is not human (meaning humans do not keep their promises, an insult). This means that those people who unconsciously become aware of the Matrix and choose to leave will be freed, and those living in Zion will not be killed. The war between man and machine is over, or at least suspended.
Looking upon the sunrise the Oracle asks Sati if that was her doing, and the girl responds that she did it for Neo (made the sun rise). Apparently Neo's experience with love, which was uploaded from him to the Source, caused the machines to show pity on Sati and give her a purpose instead of deleting her. She is now in control of the sun. Sati also asks the Oracle if they will ever see Neo again, and the Oracle replies that they might, indicating that the The One program will be used again in the future, as it had been for the previous six iterations of the Matrix. M3 therefore ends where M1 began, except that now the humans who become aware of the Matrix will be freed (a decent compromise if you ask me).