If I have an Estonian company and I want to pay myself a salary, I lose around 55%. Pension is mandatory, public healthcare is mandatory, and they take huge chunks of the %. Now you might ask why don't I want to pay for the pension, or the public healthcare, well it's because the pension fund effectively loses money with its ~2% yearly interest rate, so it's like putting money in a fire, and the public healthcare is really bad in Estonia, especially for 30%. To put that into perspective, if you make, say, 5000 eur per month, then 1500 of that goes to public healthcare, every month. Private healthcare that offers much better service, and much more coverage, is around 150 eur per month. The difference is literally 10 fold in terms of cost, and the quality is mountains different.
Now however if I have a U.S company, or really any foreign company, I can then pay myself a salary without these mandatory payments to the government (except income tax, which is 20%) and I can use the 35% that I'm saving on getting myself a private healthcare and investing money with a much better return than 2%.
Re: dividends, they are not as flexible as management salary, which I can pay in any amount, at any time, and as many times as I want. Which is what I do now, with a foreign company.