Why is this power cable sometimes polarized and sometimes not?
Your photo is the  polarized NEMA 1-15 P (Plug) to the non-polarized IEC 60320 C7.
It is safe for consumer goods that are double-insulated that do not require grounded polarized plugs for 120Vac line, Neutral nor earth ground.
However, the alternative non-polarized Receptacle NEMA 1-15 P is available but it's corresponding receptacle the NEMA  1-15 R has been  prohibited in new construction in the United States and Canada since 1962, but is still allowed for repairs to older homes.
The non-polarized plug allows the user to swap orientation in case of a difference in high frequency noise (buzz) that can sometimes be unbalanced or have inputs that are unbalanced such that swapping leads of the unintended conductor or receiver can reduce interference in audio systems.  However this is a poor man's solution to audio EMC and not often needed or explored.
NEMA is the North American Equipment Manufacturing Association that provides guidelines but  not laws nor enforcement.
What may be curious to some is your cable has a polarized male plug but a non-polarized the C7 adapter, so the above tweaks to EM compatibility can still be tried reversing line and neutral.   Although line and neutral return noise tends to cancel out, in some situations where it is not uniform  noise might not cancel yet still be below unintended radiation thresholds or may be above on grandfathered equipment not qualified.
This is the polarized version of the C7 female plug.