What's the Difference Between a Fruit and a Vegetable?

What really makes a tomato a fruit and not a vegetable?