When speaking of safety the purpose of ground in buildings and installations is to allow protections to trip (circuit breakers, fuses, etc.) in all circumstances, thus cutting the supply in case of fault (a fault may be a short circuit or a leakage; the supply scheme, insulation level, and other factors influences decision on design of protection by tripping).
If there is a short circuit (failure of insulation), e.g. inside equipment, with 1 phase touching enclosure, the enclosure gets live: if not properly grounded, this loss of insulation will never be detected.
- If it is a bolt short circuit (major loss of insulation), the overall resistance of the fault path is low, the enclosure is at the phase potential, a large short circuit shall flow through the earthing connection, and a protection will trip (fuse will blow, magnetic circuit breaker will trip, etc.).
- If the insulation failure is a leakage may be dangerous or not, depending on the overall insulation resistance that is still there, and if the operator/user is insulated from ground: so we have the typical approach for household appliances that is to detect any dangerous leakage a trip in the same way (residual current detection, RCD, also called "zero sequence current relay"), protecting humans with a suitable threshold (e.g. 30 mA); for medical environment, with patient in already bad conditions, probably much more exposed, threshold is more restrictive (5 mA).
However, one may desire that the user is protected by making him/her float, with feet insulated from earth (e.g. 100 kohm of insulation resistance, insulation sized for more than the largest voltage that might appear): in that case no danger, because 220 V / 10 kohm = 2.2 mA, that we assume safe here (see IEC 60479). Also the human body has a resistance that is summed to the fault circuit (let's say about 1-2 kohm, but depends on which part is touching ... foot, hand, ... if the person is heavy or thin, if it is a man or a woman, sweating, etc.): see IEC 60479-1 "Effects of current on human beings and livestock" for info on resistance and on perceivable/dangerous thresholds of current, for both DC and AC.
When the system is floating, we have a distribution scheme that is called "IT": the reason is continuity of service, mainly, so after a first fault a warning lamp flashes, but power supply is still there and the situation is not dangerous. It is important when the function of the involved equipment is mission critical, e.g. a data elaboration center or equipment protecting people.
The situation of a large fault path resistance, enough to protect the operator may occur, but you cannot rely on it if it is just due to a combination of factors that might occur or not (e.g. it is wet or dry, the wire you say is touching gently or boldly, the surface is oxidized, there is some paint protecting the surface). For safety it is not acceptable, and the worst case shall always be considered: in this case the problem might be the opposite, i.e. the short circuit is too weak to be detected by the main circuit breaker. This is why the farther from the point of common coupling (where the utility line gets in), the higher the sensitivity of protection: combined with the time of intervention (tripping time) this is called selectivity. It's a trade-off between availability of the supply system and protection of people even for "small events": the IEC 60479 and other electrical safety standards (e.g. IEC 60364) establish thresholds (for current through the body or touch voltage at hands, feet, ...) considered safe, on which protection are tuned and that are confirmed by calculations with worst case scenarios (design).
Of course any earthing connection of an enclosure, chassis, metallic part, shall be sized for the estimated worst sort circuit, not to blow during the mishap: sizing is done with long time intervals during which the conductors heats up, but keeps its integrity. The long time interval is usually 1 second or the time of the second protection upstream, assuming the the first one nearest to you has failed its mission for some reason (again, see selectivity). Standards are BS 7430, IEEE Std. 80, IEC 60364.
[Already quite long. Please, if you need details, just ask. Cheers]