A 'plug' is a device that attaches to the end of an electrical wire and fits into an electrical current socket, usually situated in walls. The 2-pin plug consists of two prongs, one called the 'hot' or 'live' and the other called the 'neutral'. When connected with an electric circuit, the current flows from the live to the neutral prongs. In comparison, a 3-pin plug has an additional prong situated above (or below) the live and neutral and forms the apex of a triangle. This third prong is called the 'ground' and, as the name suggests, electrically grounds the appliance.
What this means is that if the wires inside any appliance touch the appliance surface, and the surface starts conducting the current, and threatens to pass through us to the ground, the grounding will directly route the current and protect us. Thus, 3-pin plugs ensure our safety from the current, as compared to a 2-pin plug. 3-pin plugs also limit the amount of power that can flow through the circuit, as compared to a 2-pin plug. Hence 3-pin plugs are safer as compared to 2-pin plugs.
Hope this helps.