In the phylum anthophyta, seeds develop within the ovary, which matures and ripens into a fruit.
Anthophyta are flowering plants, resembling flowers, and as you already know, regular flowers have ovaries used for seeds, and when a plant grows, it can bear a fruit.