why do power plugs have 3 sockets even though many appliances have plugs with only 2 pins

Many appliances are not grounded, and do not use the third ground wire.