Aubergines have unusual flowers, in any given inflorescence (group of flowers) only the bottom flower is hermaphroditic and sets fruit. The rest of the flowers are functionally male and only serve as pollen (male gamete) donors. This sex expression system is called “andromonoecy” and is relatively common in wild relatives of the aubergine.
Species with andromonoecious sex expression can put all their investment into one large fruit rather than many small ones. Human beings have exploited andromonoecious sex expression and selected for larger and larger fruits from that one basal flower.
The fruit is green when it is immature, but when it is ripe becomes colored. Some varieties in China have fruits that are green when they are ripe. Most of the common types of aubergine have purple or purplish green fruit, but the fruits can be yellow, orange, red, purple or white.