It is important to keep in mind some of the changes that have been happening through evolution leading up to the angiosperms.
On the male side, the microsporophyll has been reduced to the stamen. The microsporangium is the tapetum of the anther sac. The microsporocytes are numerous and undergo meiosis early. The tetrad of microspores from each microcsporocyte, initially held together by the middle-lamella pectins, separate from each other but are not shed as microspores. Instead the cytoplasm inside the microspore wall divides by mitosis and cytokinesis. Thus the microgametophyte is endosporic and is called a pollen grain. The microgametophyte has been reduced from a complete thallus with rhizoids, phyllids, hydroids and leptoids, and antheridium as in the mosses, to just an antheridium as in Selaginella, to just four cells as in pine, and now is reduced to just two functional cells. In angiosperms the pollen grain now depends upon a vector to get it close to the female gametophyte. Thanks to angiospermy, the pollen can only get as close as the stigma of the megasporophyll. From there the tube cell must digest a very long path to the egg. The tube cell depends upon the maternal sporophyte to nourish it as is grows from stigma through style, ovary, locule, micropyle, and nucellus, to the egg to deliver the sperm cells. The gametophyte has gone from autotrophic, to heterotrophic, to parasitic. The sperm have lost their motility completely. The pathway from deposition by the pollinator to the egg is long. However, as we have seen, the generative cell produces two sperm and both participate in separate syngamy events (one with the egg and the other with the central cell). Reducing the gametophyte stages, where recessive traits would be expressed to the detriment of the species, to just a few cells with the genome mostly shut down as heterochromatin is quite likely adaptive. Getting it away from the need for external or even internal water is adaptive.
On the female side, we have gone from isogamete to anisogamete to egg in the green algae. The egg was then contained in an oogonium, then an archegonium of a gametophyte. The most elaborate gametophyte is arguably found in mosses (rhizoid, "stem" with hydroid and leptoid, phyllids, archegonium, etc.). Later evolution is a reductionism. The megagametophyte became endosporic (as in Selaginella), then endosporangial (nucellus as in some Selaginella species), and lost the rhizoids and was surrounded by integument in seed plants starting with the gymnosperms. In angiosperms, the further containerization of the female side continues. The megasporophyll (carpel) now completely encloses the ovules (literally angiosperm). The megasporophyll develops to become a fruit. This is a development never seen in earlier or more primitive organisms and so is an apomorphic state. We often think of the flower or at least the carpel as the important innovation of the angiosperms, but truly the definitive structure is the fruit! From a megagametophyte point of view, though, this megagametophyte is an embryo sac of just 7 cells. The archegonium is gone but perhaps is represented by the synergids (evolutionarily the neck cells?). The thallus is represented perhaps only in the antipodals. The central cell is unique to the flowering plants, its syngamy with a sperm cell results in endosperm. This is another autapomorphy of angiosperms! Of course the egg joins with the other sperm to produce a zygote.
Today, we are focusing upon the autapomorphy of the carpel that encloses the ovules inside a locule. This megasporophyll grows and/or elaborates ultimately into a fruit that contains the ovules that have matured into seeds. The carpel wall, the fruit, permits the seeds to be transferred to new locations by dispersers. This could include much longer-distance dispersal than by wind, and the direction of dispersal could be multidirectional (not just downwind). The fruit then has several possible evolutionary directions open to it for dispersing the next generation of sporophytes, with wind being just one.
One further note is that some particularly advanced angiosperms have buried the carpel of the flower in the receptacle (i. e. we have an inferior ovary and an epigynous flower). This adds an additional layer to the outside of the female tissues and also impacts the kind and quality of fruit that is produced. This line of evolution has increasingly produced tissue coverings to shield the female gamete from herbivory or environmental difficulty. From some isogamete swimming naked in the environment evolution has put an oogonium, an archegonium, a thallus, a megaspore wall, a megasporangium, an integument, a carpel, and ultimately receptacle tissue around this female gamete!. If you are picturing those Russian dolls or layers in onions, you have the right mental image of this line of evolution.
Now as we consider the development after syngamy, we realize that our whole idea of what is what inside these many layers of female structure will need to radically change. The egg will become the zygote, the central cell will become the polyploid endosperm. But then as the zygote becomes a dormant embryo and the central cell becomes loaded with storage material, the integument and nucellus will become the seed coat. Which of course changes the ovule into a seed.
As the seed matures inside the carpel, the ovary wall will change to become the fruit. In some species this wall may expand tremendously by cell division and cell enlargement. The embryo in the seed sends out hormonal signals, chiefly cytokinins (CK), which signal cell division in the embryo, in the endosperm, in the ovary wall, etc. These hormones also elicit nutrient diversion from the maternal plant. The endosperm loads up on sugars, amino acids, and acetates which are converted to starch, storage protein, and fats. If the maternal plant does not have sufficient photosynthetic capacity, the nutrients come from maternal reserves. The maternal plant may ultimately perish attempting to load its developing seeds with reserves! Such plants are called monocarpic (mono-=one, -carpic=fruiting).
Once we have the cells dividing and taking on nutrients, the next phase is to expand those cells. Cell expansion is again accomplished by the developing seeds producing a hormone. In some species this is some form of auxin (e. g. indole-3-acetic-acid); in other species this hormone will be one of the gibberellic acid isomers. In genetically sterile plants (perhaps triploid), we can treat the flowers and young fruits with sprays or dips of these hormones to induce a large seedless fruit to develop. The green grapes and now red grapes that lack seeds are good commercial successes as examples. For grapes the hormone used is gibberellic acid. Seedless watermelons are also commercially successful; you might ask what those white "seeds" are doing inside your seedless watermelon. Well, those are ovules. They said "seedless" not "ovule-less"! Even in seeded watermelons there are the typical black mature seeds, but also some white ovules. These are ovules that were never located by a viable pollen tube so they aborted spontaneously!
We now focus upon the kinds of fruits that are found among angiosperms. This autapomorphy has undergone remarkable adaptive radiation, the dimensions of which we shall only barely mention. This outline is a bare skeleton of the many possibilities for the carpel's ovary wall and its associated parts. Indeed there is much variation here that can be used for taxonomic study. Here are found just a few of the more common fruit types classified on three basic frames.
The origin of the fruit is determined by the kind and number of flowers or carpels that were joined to make the fruit. The composition of the fruit is determined by whether it contains significant contributions of the receptacle or other flower parts vis a vis the carpel itself. Finally a classification by description of the fruit is perhaps the most common way to distinguish fruit types. Obviously every fruit can be classified into each of these three different schemes...making our fruit world more complex and interesting!
A. Simple fruit - formed from a single pistil (pea, tomato, lily, apple, cucumber)
B. Aggregate fruit - formed from a cluster of separate pistils borne in a single flower (strawberry, raspberry)
C. Multiple fruit - formed from the pistils of several to many flowers consolidated with other floral or inflorescence parts (pineapple, fig)
A. True fruit - composed of only the ripened ovary, with its contained seeds (pea, tomato, lily)
B. Accessory fruit - composed of the ripened ovary with other additional parts, such as receptacle, bracts, portions of perianth, etc. (apple, cucumber, strawberry, fig)
A. Fleshy Fruits
1. Berry - few to many seeded, fruit coat soft and fleshy (tomato, grape, banana)
a. Hesperidium - specialized berry with tough, oily rind (orange, grapefruit)
b. Pepo - thick-skinned berry, with accessory rind (squash, cucumber)
2. Drupe - usually 1-seeded, fruit coat with fleshy outer and inner stony layers (peach, plum, olive, raspberry, almond)
3. Pome - fleshy accessory fruit with cartilaginous core (apple, pear)
B. Dry Fruits
1. Indehiscent Fruits
a. Achene - 1-seeded, fruit coat free from seed coat (buttercup, strawberry)
b. Caryopsis (grain) - 1-seeded, fruit coat fused with seed coat (corn, wheat)
c. Cypsela - 1-seeded, accessory fruit coat from inferior ovary (sunflower, daisy)
d. Samara - 1-seeded, fruit with winglike outgrowth (ash)
e. Nut - 1-seeded, thick hard wall, partially or completely surrounded by cup or husk (oak, hazelnut)
2. Dehiscent fruits
a. Follicle - single carpel splitting along one side only (Delphinium, milkweed, magnolia)
b. Legume - single carpel splitting along both sides (pea, bean)
c. Silique - two carpels splitting along both margins, shedding valves, leaving septum (money plant, cabbage)
d. Capsule - compound pistil, splitting lengthwise or by pores (lily, iris, poppy)