The reason why the IRS are challenging FB is that Apple's Irish tax arrangements became public and were very embarrassing to the US authorities, which were revealed not to be applying US law.
Now, to the matter of hindsight.
The essential point is that the transactions have to be a sham to work.
There is precisely no point in selling IP from a US subsidiary to one in Ireland at a fair price. That would just trigger an immediate taxable event in the US for no benefit whatsoever.
The transaction is by design intended to sell IP at a large undervalue and the game was to satisfy the US and Irish authorities, both of which were happy to play along.