Why do products need to undergo electrical safety tests?

The obvious answer is that products are regulated to protect consumers and operators from shock hazards. Shock hazards exist when a potential voltage and current are accessible to the operator with respect to earth ground. Electrical safety tests occupy very little time on the production line, but reduces the risks to operator and consumer considerably.