This is often a very helpful way to improve your smile.

Teeth are not smooth so this catches organic matter and other coloured material.

Whitening generally uses peroxides [11% 16% 34%] that convert these organic debris into soluable material that washes off.
You can use the less powerful ones at home, and it pays to use stronger ones in a dental clinic where gums can be protected and bare roots covered with protective films.
Whitening can be enhanced with strong light-based energy such as lasers, but with a little more time- even repeats – similar improvements can be achieved.
Baking Soda and Xylitol ( also check google re lemon-juice whitening- its not ok!)
It is also known that if you clean out all the rough areas these are then fresh and ready to get a new load of stains.
This is from Wikipedia.