Character in The Matrix (first movie):
In The Matrix, he was the agent who persistently pursued Neo. He was a computer program under the profession "Agent". Agents are those who keep order in the matrix by destroying "rebels" and by making sure that people don't know that they are in the matrix. Agents are said to be created by the matrix for this purpose alone.
Even if Smith is a program, he still takes the physical form of a human being like the other agents. Out of the 3 main agents in The Matrix, Smith is the one who showed the most "human" emotions. His wants exceeded his objectives and he held a personal vendetta against Morpheus (the known leader of the rebels at that time) and Neo.
Smith was "killed" in The Matrix when Neo, after realizing his abilities, went inside him and blew him up. But we all know that's not the end of our beloved Agent Smith.
Character in The Matrix Reloaded (second movie):
Smith is back and he's badder than ever! Now he is free from the controls of the matrix, which was caused by his death in part 1. Instead of being deleted, he decided to defy the matrix and is now operating for himself alone. It seems as if his current objective is to destroy Neo, but there may be more to that than meets the eye.
He can now "clone" himself unto other programs inside the matrix, including human beings, which makes him a much more dangerous adversary. He's even tried to clone himself inside Morpheus and Neo! Smith now also has the ability to travel into a "real world" by invading a person who's about to "jack out".
His true motives are unknown, but are yet to be revealed in the third installment, Matrix Revolution.