I've heard about using coffee grounds on tomato plants, and was wondering what it does to the plant.
Coffee grounds come up in gardening because they're a daily source of "green" (Nitrogen) fuel for the compost pile. The other half, browns, are easy to come by (leaves, tiny twigs, etc), and generally a 50/50 ratio is necessary to maintain for good compost. Hence, piles are always hurting for greens so gardeners are happy for a daily dose, even if it's just a filter full of used coffee grounds.
As to what they add to compost besides nitrogen, not much chemically besides having an almost neutral pH while many greens are acidic. They're just a great green source all around. They won't go bad and smell so you can store them in your house until you compost them, and they decompose quicker than most greens.
(Seemed opinion-heavy so I hunted this up:) http://homeguides.sfgate.com/fertilize-tomato-plants-coffee-grounds-35715.html
Adding coffee grounds without composting to your garden is asking for trouble. Before they produce nitrogen for plants to use, they have to decompose. The decomposition process rips nitrogen out of the soil, and will negatively affect your plants. http://extension.oregonstate.edu/lane/sites/default/files/documents/cffee07.pdf
If you're looking to turn household waste into garden fuel - by all means take up composting. But it's never a good idea to go from the kitchen right to the garden bed. http://www.vegetable-gardening-with-lorraine.com/homemade-compost-bin.html (no school like the old school)
There's a good answer on how to generally use coffee grinds as a fertilizer right here.
It's a good source of nitrogen, though your plants won't be able to directly use it until it's broken down. The direct benefits on a tomato plant specifically come from the fact that coffee grinds are slightly acidic and that tomato plants like their soil slightly acidic (most sources from a quick Google search say around 6-7, here, here, and here).