Fruit overview
In a flower, the ovary of the pistil becomes a fruit and the ovules inside it become seeds.
Gymnosperms (gymn="naked"; sperm="seed") have ovules (becoming seeds) that are not enclosed in an ovary. Therefore, they do not produce fruit.
Fruits sometimes protect seeds, sometimes help disperse seeds, and sometimes do both.
Layers of the fruit wall
The fruit wall is called the pericarp. It has three layers: the exocarp, the mesocarp, and the endocarp.
Fruit types are classified, in part, based on how these layers develop. If all layers of the fruit wall are dry at maturity, the fruit is some type of dry fruit (dehiscent or indehiscent). If any of the pericarp layers are fleshy at maturity (i.e., still containing living fluid-filled cells with flexible walls after seeds have matured), they are considered a type of fleshy fruit. Fleshy fruits usually aid in seed dispersal by attracting animals that consume the fruit without (hopefully) harming the seeds.
Accessory tissue
In some cases, the "fruit" contains more than just the mature ovary of a pistil.
Inferior ovaries always have some other type of tissue fused to the outside of the ovary:
In some cases, most of the tissue that becomes fleshy and attractive to seed dispersers consists of other flower parts (sometimes the receptacle, sometimes petals and sepals, etc.).
Any tissue in a "fruit" that is not the pericarp (the ovary wall) is called accessory tissue.
Check your understanding: