Human body consists of 70% water. The food we eat has salt in it and altogether this creates an electrolyte medium to conduct electricity. As we all know current flows from a point of high potential to low potential region. Earth has nearly zero potential so when we get contact from a electricity conducting wire, the current from that external source flows from there to earth(low potential area) through a medium which is our body.
NB: Wearing rubber chappels will save you from an electric shock because, that rubber is an insulator it won't allow current to flow through it, the current can't reach the low potential earth, so we will not get a shock.