If not taking into account the social and complex factors such as the situation of one night or picky, then plants also do 'sex' like animals.
When people look at a flower or eat a certain vegetable, they actually forget about the reproductive organs of plants. The 'male' part of the flower is the stamens filled with chalk, while the pistil is an egg-like part.
Most plants will bloom 'bisexual' flowers (both male and female on the same flower), but there are also species like zucchini that grow their own 'male' flowers, their 'female' flowers. And as evolutionary biologists have discovered, monoculture plants will produce more seeds.
The reason why is still a mystery that science has not been simple, but probably because 'male' flowers consume less energy of trees, assuming Life's Little Mysteries page.
The next question is how do flowers work 'that' ?
Using nature as a matchmaker, wind, animals and water will bring pollen to the head of the pistil. Pollen grains will stick to the stigma, then germinate and grow downwards, slowly 'crawling' to the ovary. Finally, pollen grains will 'penetrate' some eggs and thus the seeds will be born.
However, flowers are not the only 'relationship' of plants. Ginkgo trees will grow both female and male plants in the same place. Male plants produce spores, which later develop into sperm and swim to the eggs inside the female ovary. Even so, there are many types of plants like duck that completely say no to 'sex' . They produce clones and grow into mature plants without mating.