As explained in the IRS instructions below, the IRS may make adjustments to an individual return if they determine that reasonable compensation was not paid (and reflected on a Form W-2 issued by the S-Corporation), for services rendered or capital furnished to the corporation. This is outlined in the Internal Revenue Code, Section 1366(e).
This is also explained on the IRS website S Corporation Compensation and Medical Insurance Issues:
Several court cases support the authority of the IRS to reclassify other forms of payments to a shareholder-employee as a wage expense and subject to employment taxes.
Per the IRS Instructions for Form 1120S U.S. Income Tax Return for an S Corporation, page 16:
CAUTION! Distributions and other payments by an S corporation to a corporate officer must be treated as wages to the extent the amounts are reasonable compensation for services rendered to the corporation.
Enter on Line 7 the total compensation of all officers paid or incurred in the trade or business activities of the corporation. The corporation determines who is an officer under the laws of the state where it is incorporated.
Enter on Line 8 the total salaries and wages paid or incurred to employees (other than officers) during the tax year.
CAUTION! If the corporation claims a credit for any wages paid or incurred, it may need to reduce the amounts on Lines 7 and 8. See Reducing certain expenses for which credits are allowable, earlier.
Don't include salaries and wages reported elsewhere on the return, such as amounts included in cost of goods sold, elective contributions to a section 401(k) cash or deferred arrangement, or amounts contributed under a salary reduction SEP agreement or a SIMPLE IRA plan.
If the corporation's total receipts page 1, line 1a, plus lines 4 and 5; income reported on Schedule K, lines 3a, 4, 5a, and 6; income or net gain reported on Schedule K, lines 7, 8a, 9, and 10; and income or net gain reported on Form 8825, lines 2, 19, and 20a) are $500,000 or more, complete Form 1125-E, Compensation of Officers. Enter on Form 1120-S, line 7, the amount from Form 1125-E, line 4.
Include fringe benefit expenditures made on behalf of officers and employees owning more than 2% of the corporation's stock. Also report these fringe benefits as wages in box 1 of Form W-2. Don't include amounts paid or incurred for fringe benefits of officers and employees owning 2% or less of the corporation's stock. These amounts are reported on line 18. See the instructions for that line for information on the types of expenditures that are treated as fringe benefits and for the stock ownership rules.
Report amounts paid for health insurance coverage for a more-than-2% shareholder (including that shareholder's spouse, dependents, and any children under age 27 who aren't dependents) as an information item in box 14 of that shareholder's Form W-2. A more-than-2% shareholder may be allowed to deduct such amounts on Schedule 1 (Form 1040 or 1040-SR), line 16. To find out if the shareholder can claim this deduction, see Self-Employed Health Insurance Deduction in chapter 6 of Pub. 535, Business Expenses.
If a shareholder or a member of the family of one or more shareholders of the corporation renders services or furnishes capital to the corporation for which reasonable compensation isn’t paid, the IRS may make adjustments in the items taken into account by such individuals to reflect the value of such services or capital. See section 1366(e).