how are fruits formed ?
After fertilization i.e. after the fusion of male (pollen) and female (ovule) gametes:
The ovary gives rise to the fruit, while the other strucures of the flower fall down. Thus, the fruit is a ripened ovary.
The ovules present inside the ovary develop into a seed. Seeds contain an embryo, which is protected by the seed coat.