All persons ('withholding agents') making US-source fixed, determinable, annual, or periodical (FDAP) payments to foreign persons generally must report and withhold 30% of the gross US-source FDAP payments, such as dividends, interest, royalties, etc.
Exemption from withholding To qualify for this exempt status, the employee must have had no tax liability for the previous year and must expect to have no tax liability for the current year. A Form W-4 claiming exemption from withholding is valid for only the calendar year in which it's furnished to the employer.
The IRS requires a flat 30% withholding on ALL types of payments to foreign national individuals UNLESS: The individual has a U.S. tax identification number (SSN or ITIN) and qualifies for a tax reduction under the tax treaty between the U.S. and their country of tax residency.
Payments to a foreign corporation in exchange for personal services performed in the US by either a US citizen or alien is considered to be US-sourced income and is usually subject to withholding. (Can be wages or self-employment income.)
This is a key point in understanding how can a US company hire a foreign independent contractor. As long as the contractor complies with the tax and legal requirements of their home country and the U.S., they can provide services to a U.S. company without being considered an employee.