Popular wisdom says that you need two avocado trees at a certain distance (it can be dozens of meters) to enjoy its fruits. If we want our tree to have many avocados, this is partly true.

These trees have flowers with male and female reproductive organs. The male, through pollen, fertilizes the female to form the fruit, so we can think that the same tree could self-fertilize as many plants do, however in this case it is not so simple. Avocado flowers are bisexual, they have functionally male and female organs but they are separated in time by a mechanism known as protogynous dichogamy (temporary separation in the maturation of the sexes within the same flower or the same plant). This means that when the female flower is ready to be fertilized by the pollen of the male flower, the male flower is not ready (the reverse also occurs). Each flower opens twice; the first time functionally as a female (receptive stigma); then, it closes and opens again the next day functionally as a male (dehiscence of the anthers).
The different types of avocado are classified into two groups (A or B) based on their floral behaviour. In type A plants, the flowers open in the morning in the female state, close at midday and open during the afternoon of the following day, opening in the male state. In type B plants, the flowers open during the afternoon in the female state, close at dusk and reopen in the morning of the following day. However, it is common to observe flowers in different sexual stages on the same tree, favouring self-pollination, so that the avocado does not necessarily need another avocado to produce fruit. However, self-pollination produces few, if we want a good production we need more than one avocado. This behaviour is highly dependent on environmental conditions, mainly temperature, so that fertilisation can occur.
Source: EMEDEMUJER