When is an earth ground necessary?
The regulations are described here: https://en.wikipedia.org/wiki/Appliance_classes . Actual implementation varies by country - all UK sockets have 3 pins for example.

Small appliances can use low-current low-voltage DC. All the safety isolation is in the wall wart; it's not possible for the appliance itself to fail in a way that gives the user an electric shock.

Larger appliances either have a power supply built in or use mains directly (drills, white goods, lamps, etc). These must either be double-insulated or have an earth ground.