Not all plants are flowering ones although these by far are the largest group. Within flowering plants, there are two disctinct divisions, the gymnosperms and the angiosperms. The names mean naked seed and enclosed seed respectively. Gymnosperms produce seeds which are not enclosed in part of the ovarian tissue or fruit. Instead they are borne on cones. For example pine, spruce and fir trees.
In angiosperms, the seeds are protected in ovarian tissue or part of it. The ova are contained in a locule inside an ovary and after fertilsation, this part of the female reproductive system swells to produce a fruit and inside this will be the protected seeds.If you consider an apple, the fruit we eat is actually the swollen ovary of the base of the flower (you can still see the remains of the flower at one end of the apple (away from the stalk).
It is thought that angiosperms developed this form of protection for their seeds in order to ensure distribution as far as possible from the parent tree or plant. If you are a seed enclosed in an ovary inside a fruit which is eaten, it is likely you will be taken a fair way from the parent plant before being deposited out the other end of the animal. Not only that but you will be deposited in your very own manure - dung.
The downside is that angiosperms have to put a lot of energy into ensuring ther flowers get pollinated and they do this by having large flowers with scent and rich nectaries. Most gymnosperms are wind pollinated which requires relatively little energy but a lot of pollen in the hope some at least gets transferred from plant to plant.
Angiosperms tend to favour insect , bird, moth, bat or other animal pollinator and put lots of energy into attracting them. They produce fewer seeds on the whole and their flowers are slightly diferent from gymnosperms. They have two pairs of pollen sacs on the stemens to gymnosperms' one.
The male plant or gametophyte is far smaller in angiosperms than in gymnosperms because they are contained within the floral structure. Pollen grains are smaller to help quicker fertilisation after pollination. This helps angiosperms set seed qwuickly and is an advantage to the plants.
In angiosperms, as soon as fertilisation has occurred the carpel closes to form the beginnings of the fruit. This protects the developing emryo and ensures its survival, as much as possible. Many angiosperms are invaluable to Man as crops, providers of chemicals and building materials.