Making mayonnaise involves beating oil into small droplets in water, in the presence of egg yolk. What is the purpose of the egg yolk?
The egg yolk (or so I am told) is a source of lecithin, which acts as a sort of edible detergent.
Mayonnaise is mainly oil (which emulsifies with water), and a few water-based flavourings. The egg yolk is a source of lecithin, which has hydrophilic (water-attracting phosphates and ammonium) groups, and hydrophobic (water-repelling) alkyl and alkenyl chains. The compatible parts of the mixture (like with like etc.) aggregate and thicken up the sauce.
Some professional chefs (and probably most commercial manufacturers) use lecithin at the expense of egg-yolks. As you probably already know, the mayonnaise you make at home with good oil, and egg yolks and real vinegar and salt and sugar and pepper and mustard, tastes rather good.