It's too bad the comments here are so partisan and so devoid of nuance. I'll attempt to add some:
As to the new tax bill, yes, it plays a direct role on this. Under the new bill, companies can repatriate overseas holdings for a one-time tax of 15.5%. That is new, it's aimed squarely at Apple, and it accounts for the $38B in taxes that Apple is willing to pay on these holdings. Put differently, Apple has said all along that it wanted to bring this money back to the U.S., but would do so only at a more favorable rate. Now that it prevailed, it is doing so. That $38B is a big victory for the U.S. economy.
So does this mean the new tax bill is good for America's economy and its middle class? No and no. Tax bills -- this one in particular -- are big, complex things. While the repatriation benefit was very welcome, the bill contains numerous problems, some of them quite significant. First, it provides enormous tax benefits to wealthy individuals and does so in a variety of ways. None of this is needed, as these individuals were already undertaxed by most metrics. At the same time, many (not all) in the middle class will be pinched by losing key deductions. This nonsensically makes income inequality worse, and it's a big problem already. Apart from a basic lack of fairness, income inequality hinders growth by concentrating wealth among people less likely to spend their money (and thereby create jobs). Second, the tax bill enormously inflates the deficit. This means the economy will be worse (far worse, actually) all else equal, for the next generation. It's good politics but very bad public policy to benefit current voters at the expense of future ones. Third, to the extent the tax plan provides a short term stimulus (and it will), it's improperly timed. We currently are in a "hot" economy, caused by various long-term and cyclical factors. The economy is growing and jobs are being added. Adding stimulus now increases inflation and leaves us without a mechanism for stimulus when it is needed (i.e., when the economy cools off, which also will happen within the next few years). Thus, for our feast now, we must endure a harder famine later.
Since this stuff is inherently political, it should be noted that it's very possible to argue for lower corporate taxes, a reasonably low repatriation tax (at least on occasion) and *higher* taxes on wealthy individuals. There are even solid metrics on how this should work, i.e., what those taxes can look like before incentives to develop wealth are reduced. There's no contradiction between saying overall that this tax plan is deeply problematic, and acknowledging that it will lead to some positive things along the way. Unfortunately, those passing the bill understood that most of the problems will be felt after they leave office.
For the above reasons, the tax bill is much better for Republicans politically than it is for the U.S. economy, and everyone in Washington knows that. At the same time, Apple's announcement is good news and should be celebrated. We should be able to walk and chew gum at the same time.