What I am saying is, I can insert the plug both ways. I was wondering how this is possible and why the direction of current flow doesn't matter here, as opposed to DC appliances.
By definition, AC doesn't have polarity. AC is a sinusoidal wave where during some time one terminal voltage is higher than the other, while in the second semicycle, the second terminal voltage is higher than the first.
A better question might be why there is any asymmetry at all.
The AC voltage goes from about -340 to +340V 50 times a second in most of the world (half that at 60Hz in North America). That's measured from one pin to the other. So from the point of view of the two-terminal device, things look pretty much the same either way.
Relative to ground, however, there is typically one pin that is close to earth in potential and the other which is at a high AC voltage. If you touch the "neutral" and you happen to form a path to ground you should not get a serious shock (if it's wired right, which is not always true). Thus it's safer to have the neutral connected to, say, the shell of an Edison-base bulb so that if the person replacing the bulb touches the thread they will be less likely to experience a substantial electrical current flowing through their body. As is typical in Engineering, we pick the solution which costs a bit more (asymmetrical sockets and plugs) but fewer dead bodies result.
There is somewhat of a similar thing, not safety related, with EMI where noise is conducted out to one of the pins, again making it asymmetric.
In North America the 240V is symmetric with respect to ground (each side is 120V with respect to the neutral, so both sides are the same). A similar arrangement is used with 110VAC 50Hz, as I understand it, in UK construction sites, for safety reasons (a 55V shock is less likely to be fatal than a 120V or 230V shock, and construction sites tend to have pools of water and such like).
In the devices you show, there is (well, there should be if it is made properly and genuinely safety agency approved) electrical isolation in the device so that contact with the mains (either side) is very (and equally) unlikely no matter which way it is plugged in. Since the isolation is very reliable it does not require a ground pin for safety. This can be called "double insulated" where the requirement is that no single failure can cause contact to the mains, but it may involve more than 2 layers of insulation (or fewer where the insulation is very thick and therefore assumed to be extremely reliable).
It depends on the application and the resultant safety requirements. A lot of devices simply rectify the AC to DC, and so the polarity no longer matters in some cases. However, even if a device is rectifying, things like switches may still require a polarity plug, due to wanting the switch to be on the live side. If a device is double insulated, this further reduces the possible need for polarity.
For certain applications, polarity doesn't really matter. For example, in a resistive heating application (like a toaster), disregarding any control electronics, the heating element is going to get hot regardless of the polarity.
For things like the iPhone charger referenced, the process of rectifying the AC makes the polarity on the plug essentially moot as well, since on the other side, you're going to wind up with controlled DC.