system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What determines if a plant is a fruit or a vegetable?
gpt
It depends on the context since different words mean different things in different contexts. 

In botany, fruit refers the part of a flowering plant that has seeds. Things like apples and pears are botanical fruits, but so are tomatoes, cucumbers, legumes, and eggplant. The thing that makes them all fruit is they come from flowering plants and contain the seeds from that plant. 

Vegetable is not a botanical term.

In cooking, fruit usually refers to any part of a plant that tastes sweet and is often eaten uncooked. A vegetable is usually any part of a plant that is savory and is often eaten cooked.

There are some legal classifications for foods too that may be different than the above definitions. For example, imported vegetables might be taxed differently from imported fruits and the law would just have to have a list of what counts as a fruit and what counts as a vegetable. Or it might matter for meeting nutritional guidelines (this is where "Congress said pizza sauce is a vegetable" comes from).

So a tomato is a fruit botanically speaking, but a vegetable in terms of cooking. On the other hand, jicama is not a botanical fruit, but it is a culinary fruit.