Egg yolks contain lecithin - which is a powerful emulsifier - meaning it will help to bind the oil (from the butter, vegetable oil and fat from the pancetta) with the pasta water to create a smooth sauce. The egg yolk also contains fat, which adds richness and flavour. The egg white also acts as an emulsifier (to a lesser extent) and as a thickening agent - meaning you'll have a thicker, more sumptuous sauce.