You get a shock when current flows through you because it's trying to get back to the transformer via the general mass of earth.
If the transformer wasn't earthed you wouldn't get a shock because the electric would have nowhere to flow (Kirchoff's law), which is how a shaver socket works.
However if the transformer wasn't earthed the voltage would "run away" and you would get an unacceptably high (400 or 500v) flowing which would mess up all the electrical equipment.
Alternatively ALL of the equipment could be class 2 which doesn't require an earth.
Sorry if someone already mentioned that, to be Frank I couldn't be bothered trawling through the last 7 pages.
Kirchoffs law....It all came back there, put me in mind of a funny old lecturer at College in Glasgow.....Kirchoffs, Thevonins, Superposition....ah the good old days..I really enjoyed my time as a Student...you dont know how good you have it until you get out into the big bad world....then you get a fright...and before you know it 10 years have passed..youre married and kids......sometimes you remember your youth ...and you are there again....