How did Chile and Italy end up with the same plugs? What about China and Argentina? Moreover, how did Chile and Argentina and Bolivia all end up with different socket types despite neighboring each other?
It seems like there’s a bunch of weird pairings of countries that don’t seem to have much of a shared history, while countries that border each other outside of North America and Europe have a lot of variation.
In the beginning, there was electric lighting in homes, but not yet appliances. Then appliances started being made; the earliest plugged into light sockets. This wasn't the most convenient arrangement, and manufacturers started making sockets and plugs. Different appliance manufacturers made different incompatible sockets and plugs, to encourage consumers to continue buying their products, rather than those of competitors, to avoid the inconvenience of changing sockets.
When countries started to standardise, to pick standard socket and plug types, there was already a plethora of types in use. Often, the type that was most common in the country was chosen, which led to the diversity you note. Where standardisation was at the state/province level, standards could and did vary within countries.
This question has been asked before, and the above is just a quick summary of past answers. For more, see:
u/Mitheral in https://www.reddit.com/r/AskHistorians/comments/5gppo2/in_the_us_when_was_the_standard_two_prong/
Fred E. H. Schroeder. (1986). More "Small Things Forgotten": Domestic Electrical Plugs and Receptacles, 1881-1931. Technology and Culture, 27(3), 525-543. doi:10.2307/3105384