Very little can be added to what drwebb said.
The main functions of a gear lubricant are wear prevention, friction reduction between the mating surfaces, and to carry away the heat developed during friction.
Some comments on EP additives. EP means extreme pressure additives. These actually act by "corroding" ie, reacting chemically with the protected surfaces.
In more severe sliding and loading conditions, as in gears, simple adsorbed or chemi-sorbed anti-wear additives will eventually be inadequate to prevent severe adhesion.
If the temperature increase caused by surface friction is too great the adsorbed molecules will desorb and the protective film will no longer be present to prevent adhesion of the surfaces.
Thus, more powerful films are required. These films are provided by reaction of various chemicals with the metal surfaces, and most of these chemicals contain sulfur, phosphorus or chlorine.
The combination of local high temperatures, increased surface energy, and any catalysis or activation process that may take place, makes the action of EP additives more specific, taking place preferentially at the wear points where it is most needed.
Because the reacted surface has a lower shear strength, the sliding friction is markedly reduced, and the tendency to severe adhesion will also be reduced or eliminated.
Many thousands of compounds of P, S, and Cl have been checked and found successful, from the mildest phophorus-containing compounds through the middle active sulfurised types to the most reactive chlorine compounds.
EP additives are, in fact, selected to obtain the best balance between corrosiveness and protection for the wide range of systems in which they are used.