A fruit is a structure that bears the seeds of a plant, and is the result of fertilisation. So the plant grows, flowers, the flower is pollinated, and develops into a fruit containing the seeds for the entire cycle to start again. The fruit tends to be the vehicle to keep this process going. Many fruits are brightly coloured to attract birds who will digest the fruit and then deposit the seeds in a nice package of fertiliser (bird poo!) elsewhere where the new plant will grow. Alternatively some fruits – legumes for example will dry out and the seeds they contains (peas or beans) will fall out onto the ground ready to grow again.
So everything else must be a vegetable, right? Wrong! Botanically speaking a vegetable doesn’t mean much. For example the peas and beans we eat (that come out of the fruit/pod) are actually the seeds of the plant, and classed as so. The stems of rhubarb or celery are classed as stems… and the leaves of kale, lettuce or spinach…. Yep you guessed it, they are classed as leaves.
The current definition of vegetable is largely based on the non-botanical cultural and culinary tradition. It has come to mean pretty much any part of a plant that is not a fruit or seed, and that has a culinary use.
The best summary of the history of the use of the word vegetable I found was actually on Wikipedia, and I think this definition sums up the modern use of the word nicely:
The word "vegetable" was first recorded in English in the 15th century, and originally applied to any plant. This is still the sense of the adjective "vegetable" in biological context. In 1967, the meaning of the term "vegetable" was specified to mean "plant cultivated for food, edible herb or root." The year 1955 noted the first use of the shortened, slang term "veggie"