A companion blog post to this explains what goes into where to set up a company. But once a business is set up in a certain places that's not the final word on what laws and countries matter. Businesses need to be careful to try not to have their activities be regulated by places that they don't intend. In order to do that they need to be mindful of their actions, server location(s), who they do business with (along the way to serving their customers), their contracts, and where the people who run their business are located. These are all factors that lawyers can advise on and companies can exert control over. On the other hand, there's a number of factors they have a lot less control over, which might ultimately end up allowing someone to sue or maintain an action in a foreign place.

