Trees are, what they call, sessile organisms. They cannot move. A male tree cannot go over to a female tree for the purpose of fertilization or vice versa.
So, they have to depend on somebody else to carry pollen (plant sperm) from one tree to another to unite it with a flower ovary. This somebody is called a "pollinator." Pollinator could be simply the wind or any insect that does this job. Bees, it turns out, are the most effective pollinators.
Each flower contains both ovary and pollen. But, pollen from a flower cannot fertilize ovaries of the same tree variety. So, the standard practice is to plant alternating rows of two compatible varieties (cultivars) so that each acts as a pollenizer for the other.
Honeybees forage for nectar and pollen in almond blossoms. They use this pollen to produce food for the queen bee and their brood (larvae) in the hive. While bees are busy doing this, pollen easily sticks to their legs and travels to a compatible variety tree where it gets rubbed off on a flower ovary when the bee is busy collecting its nectar.
Fertilized ovary at the base of a flower develops into an almond fruit with nut inside.
Here's a flower anatomy (courtesy: Brittanica)
Bees at work: