In the US, modern two prong outlets are supposed to have one wider slot and one more narrow slot (or long, short, depending on your point of view). That way the polarized plug with one larger prong and one smaller one can only go in the socket one way. That ensures that the "common" side of the socket is connected to the internal circuitry of the device that is the "grounded" or "common" side and that the "hot" side goes through the switch. Think of a lamp, you want the switch to turn on and off the hot side, not the common side. The common side should always be continuous, unswitched, so that the path to ground is never broken. You control the on/off by controlling the hot side, where the power is.
Before polarized plugs, it was fairly common to get that reversed, which could lead to the chassis of a device being "hot." I remember touching the chassis of an older radio transmitter that was plugged in backwards and being grounded myself, I got a jolt by completing the circuit from hot to ground. Not fun. More modern electronics with large chassis use isolating transformers to keep the internal parts of the device from ever actually being connected directly to the mains. That way if the plug was reversed, it didn't get to the chassis because the transformer output was always properly wired up, even if the input was reversed. Hence, the chassis was "isolated" from the mains.
Apple doesn't use polarized plugs on the duckhead, which seems to indicate the the first place the power goes in the brick is to a transformer that isolates the mains power from the rest of the unit. Once it passes through the transformer, the power is no longer "attached" to the mains, so polarity is not a safety factor. The unit is "isolated" from the mains, hence the name "isolating transformer" that you can see at the top of the image in post 9. I don't think the red dashed line labeled "isolation boundary" is correct, as a lot of the components NOT inside the boundary should be isolated and using the lower and isolated voltage coming out of the transformer. Basically, what is on the hot side would be the transformer and fuze, and little else. The item labelled "optoisolator" is another way to separate devices but allow power to flow between them. Assuming that the device actually an optoisolator, it may be that is another isolator, perhaps to isolate the Mac from the internals of the brick but to let the power output of the brick to get to the Mac. That way if there is a short in the brick, the Mac user doesn't see any current flow through because the optoisolator will block anything above a certain voltage threshold, likely the power output 16.8v or 18.5v that Apple designed. So a safety factor could be used to break the optoisolator if the output of the brick exceeds some value, say 25v (I have no clue if that is correct, just a guess at a reasonable limit on my part). So, the brick has two protections--a fuze on the input from mains that will blow if current flow is too high and an optoisolator in the output side to protect the Mac if the voltage regulation breaks down and/or a surge current gets through somehow.
I would bet that the people who get shocked by the third party knockoff charger units get zapped because the cheaper power supplies don't have the optoisolator on the regulated side, or the grounds of the unregulated and regulated sides of the brick are shared.
BTW, the same theory works with the UK and any other three-pronged standard country. It is possible to use a two prong plug in the UK as long as there is something in the third prong to unlock the socket. It just has to be there physically. I've seen UK plugs with just a plastic prong to do the unlocking. The same hot/common circuits apply there. One of the other two is "hot" and the other is "common" and from there on, it's all the same.