Basically, you are rewarded for your intentions...
If you intend to do good deeds... hoping to get a reward from Allah.. (that is a good intention)
If you intend to do good deeds... hoping you might impress someone.. (that is a bad intention)
If you woke up today... with the intention.. I'm going to free a slave today (hypothetically speaking)... but you get run over by a car or something and you die... you will be rewarded for freeing the slave because you intended to free a slave...
If you woke up today.. with the intention.. I'm going to free a slave today so I can look superior in front of my companions... or better in religon than your companians.. and you get run over by a car and die... you will not be rewarded for freeing a slave... because you didn't have the intention of seeking Allahs pleasure.
So, basically, when you have a good intention... you're doing deeds for sake of Allah and hoping to seek reward from Allah...
Where as, bad intention is you doing deeds to seeking worldly pleasure, or approval of someone other than Allah.
Hope that explains it... if you're still confused.. don't hesitate to ask.
W'salaamz,
Hamid