Distributed startups often use a 3rd party to do the actual employment/compliance of people across N countries. Those providers are called Professional Employer Organization (PEO) and serve as Employers of Record (EOR) - handling employee/contractor agreements, payroll, compliance, tax, etc. The startup itself does not even register a legal entity in the country, and everything is managed by the likes of Papaya Global, Globalization Partners, etc.