It keeps the mating metal surfaces (especially the cam metal and lifter metal) from scratching each other (makes the oil more "slippery") It builds up a bit too so you don't have dry starts.
It used to be in all gasoline engine oils but was taken out due to the claim it was killing catalytic converters. (Diesel motor oil used to be much higher too)
After the switch to low zinc oil, motors have been wiped out with great regularity, especially new rebuilds. ZDDP is the main anti-wear agent used in "break in oil" that the dealers sell. (only way they can still sell it)