The tax is applied when the money is repatriated, which Apple would need to do to pay the shareholders.
because dividends are something paid by the corporate entity, which is Apple. AOI can keep its money off shore because it is another corporate entity? Which raises the question to me of why not move the entire Apple corp off shore? That way the corp could distribute its non US earnings without paying US taxes at all.
A Samsung has a big advantage over a US based corporation in this regard. It can have research facilities in the US, but its global earnings are likely taxed at a much lower rate than the US company with the same degree of US based research and production.