Neo saw that it was impossible for Zion to survive the machine attack.So he decided to offer a peace treaty to the machines. Now i can hear you ask the lethal question; Why would the machines accept that peace offer? They're strong enough to destroy all those who rebel and they've got no feelings.So why accept the offer?
Simple, the machines are in trouble as well. The Matrix, the world they simulated to use people as a source of energy, was taken over by Agent Smith. They simply couldn't control him anymore. He kept copying himself until he took the control of the matrix. But, even Agent Smith had a weak point; He had a mission to accomplish and had no idea that he'd be deleted automaticly after achieving his misson. And that's where Neo comes forward because Smith's mission was to destroy/kill/terminate/eliminate Neo.
So Neo went to the city of the machines to offer them a peace treaty.Of course the machines didn't know that in the first place and that's why they attacked their ship and killed Trinity.When the offer was accepted by the machines and Neo was once again released to The Matrix -now ruled by Smith- there was only 1 more problem; Neo didn't know how to kill Smith. So they start fighting and keep fighting for a while until the oracle -prisoned inside Smith- gave Neo the most important tip;
The existance of Smith depends on the existance of you! Or in other words, if you die, Smith dies as well!
So Neo thinks, "Hmmmm....Then i gotta destroy myself! And how to do that? Oh I know, i'll let Smith copy himself on me, which will cause his mission to end and then he'll be deleted automatically" and he lets Smith copy himself over him and *Poof*
Both Neo and Smith are dead, the oracle's free, the Matrix runs again and the people of Zion are free as well.
That was not a satisfying end if you ask me and i suspect that the Wachowski brothers will make more Matrix movies.Just like in Star Wars.Oooh Star Wars! But i already wrote a lot, we'll talk about that later.