What, or who is the Oracle, and how does this program function?
The Oracle, described by The Architect as "an intuitive program, initially created to investigate certain aspects of the human psyche", has been around since the beginning. She's experienced the 5 previous versions of the Matrix, and has guided The Ones along the path in each version. Over time, her purpose has changed: She's learned more about the human psyche than any other machine or program; she has seen them struggle, fight, fall, get back up, and keep going. She's seen them live, love, and die. She's seen Ones follow the path. She's seen others put their faith in The One and do everything necessary to assist him or her. In short, she's seen it all. And she's learned.
As each version of the Matrix played itself out, The Oracle has learned a bit more about the human psyche, a bit more about what makes humans tick. Couple this knowledge with a weariness of the unending war, and a desire to see humanity on equal footing with the machines again, and you've got a whole new purpose for the Oracle, and the makings of an interesting game.
With Neo and version 6 of The Matrix, The Oracle finally has the information, and the perfect candidate to accomplish something she's been trying to achieve for quite a while: the end of the war. For as the Architect balances the equations of the Matrix. the Oracle unbalances them. Every bit of information she gives to Morpheus, Trinity, or Neo is a carefully worded push in the right direction, to ensure events play themselves out as she wishes.
Neo's not the One? Hey, no pressure; he's just a member of the team there to help. That'll ensure he follows a path of heroism and self-sacrifice essential to the success of her plan, and doesn't get overwhelmed by having the weight of the world on his hacker shoulders.
Trinity will fall in love with The One? That's to ensure that The One's connection to humanity is specific - a powerful connection to one person, thus ensuring Neo makes the right choice in The Architect's chamber. In Neo’s last hack before he realizes who he is, Agent Smith shoots and presumably kills Neo. However Neo can't be dead because Trinity loves him, therefore he's The One, and the connection is established, if not strengthened.
The One is a pawn in the game, one where the stakes are incredibly high. He's the most critical pawn, to be sure, but a pawn nonetheless. The Oracle matters more than anything, without her the humans have no chance to break the cycle and end the war, thus Seraph's statement "I protect that which matters most" is very true. Further she sees a unique opportunity in Agent Smith's ascension: here's a way to unbalance the equation this time around. Here's a way to ensure a different outcome than the five previous times.
So she uses Seraph to protect her until the critical moment, and she continues to feed Neo just enough information to make sure he does what she needs him to do. In the park, she gives him the nudge that he’s already made a decision about Trinity's fate - if he has, it sure isn't death. It has to be life, and it follows from love. Later she makes sure Neo understands Smith is the target now, not the machines.
Neo's role is not to fight the war; it's to fight Smith, but why? “Because everything that has a beginning has an end… You, me, Smith, this war, the machine's enslavement; all these things can and will come to an end. And sacrifices are necessary to achieve the end.” After Neo leaves to reflect on her guidance, The Oracle sacrifices herself to Smith, hoping Neo has gotten the message, and knowing if he fails, this is her end. She plays Smith by providing him her sight, which leads to overconfidence when he sees the end coming.
As The Oracle hoped, Neo goes to the machine city to broker peace, and ends up facing off against Smith. After a lengthy battle, The Oracle has one final move to make: Smith repeats her quote about everything having an end, giving Neo the final push he needs. He accepts his fate, thus excepting he must die, which unbalances the equation and gives control of a purposeless Smith to the machines. As Smith himself said: "Without purpose we would not exist". Now that he's destroyed Neo, his only purpose is in coming back, Smith is left with nothing and the machines are able to delete him.
In the final scene The Architect acknowledges he's been played, telling The Oracle it was a dangerous game she'd been playing. The Oracle's long, risky gamble has finally paid off, and she's led the way to the first peaceful co-existence between man and machine since man first created machines, so long ago.