It's common practice to classify fruits and vegetables based on the way they taste, not necessarily on their biology. Grocery stores, recipes, markets etc. all group produce according to flavor not science. But what exactly constitutes fruit vs. vegetable?
A fruit is the mature ovary of a plant. Fruit, normally fleshy, contains a large seed within, such as an avocado or peach seed, or numerous tiny seeds, ass with a tomato or an orange. All produce that contains seeds is botanically classified as fruit.
A vegetable is a plant's edible stem, root, tuber, leaf or flower. For example, celery, carrots, potatoes, lettuce and cauliflower are botanically classified as vegetables. Sometimes, more than one part of a plant can be consumed, such as the stem and flower (ex. broccoli) or the root and leaves (ex. beets).
Fruit such as tomatoes, eggplant, string beans and squash are often mistaken for vegetables because they are used in savory recipes. Grocery stores and cookbooks add to the confusion by labeling and organizing produce according to culinary usage, rather than botanical classification.