A raw socket allows creation/consumption of bespoke packet types (i.e. not Tcp/Udp). In this case ICMP.