Many of America’s largest corporations shift a surprising portion of their profits overseas to avoid paying taxes. Even more surprisingly, that’s a legal thing to do.