> Social security, healthcare, pension needs to be paid. So either the employee is a freelancer, or company has an office in the same country to pay the employer's dues.
This is important!
The labor market in most EU countries is very strictly regulated, mostly to the benefit of the employees. If the company you try to work for does not have a branch in your country (chances are, they don't) then there is a huge bureaucratic burden and sometimes even a legal grey area.
Speaking from a German perspective, its barely worth it to try to apply for a remote position at Facebook (at least based on the salaries I've found). As a contractor you'd have to battle a huge administrative effort in terms of social security and healthcare, not to mention that everything is more expensive as a freelancer since there is no employer contribution to your healthcare payments. In the end you may end up with slightly more money in the bank, but with fewer employee protections and a huge administrative burden. So I'd really question if it's really worth it.
However, Germany is actually a market with decently high salaries for the IT sector, unlike some other countries like Italy. So I could imagine that there is significant demand from other EU countries