The unfair competition came not from Japan or South Korea this time. According to some small businesses yesterday, it came from the YMCA and other nonprofit institutions.

These small-business representatives, opposing the tax benefits given to profit-making ventures run by nonprofit groups, brought their grievances to the House Ways and Means subcommittee on oversight yesterday.

"We do not object to Girl Scout cookie sales," said Joseph F. O'Neil, chairman of the Business Coalition for Fair Competition. He said his group is simply committed to preventing gross abuses of a special tax status that push out private competitors.

Small business associations claim that college bookstores selling computers, nonprofit hospitals dispensing hearing aids, and retired persons groups providing pharmaceutical supplies are able to undersell private firms that have no special tax status. Private health clubs, for example, have complained about competition from YMCAs.

The subcommittee is considering new tax rules intended to define how closely an income-generating activity must relate to a tax-exempt's purpose to be protected from taxation.

For their part, representatives of tax-exempt organizations were on hand to dispute claims that they are violating tax laws regarding business activities of nonprofit organizations, activities that often generate the revenue necessary for fulfilling charitable purposes.

"The business community just wants a new definition of exempt activities to protect itself from any competition," charged Marion R. Fremont-Smith, who represents the Independent Sector, an association of tax-exempt groups.

O'Neil said, "Universities are probably the single greatest source of unfair competition."

In addition to selling products that critics say are only marginally related to their educational purpose, academic departments of universities can underbid private consultants for government contracts. A typical case might involve an engineering firm vying for a contract to draft an environmental impact statement, according to Frank S. Swain of the U.S. Small Business Administration.

"There's no question that every time a tax-exempt organization participates in an unrelated business activity, it is in direct competition with the private sector," said O. Donaldson Chapoton, deputy assistant secretary of the Treasury for tax policy.

Congress last addressed the issue of competition between private and nonprofit sectors in 1969. Since then, the rules on unrelated business income taxes have burgeoned into a maze of case law and piecemeal legislation designed to counter specific tax rulings, Chapoton said.

Ensuring compliance has proven difficult for the Internal Revenue Service.

"Clearly, there are some who do not comply with the law, but a majority of audited tax-exempts do comply," said IRS Commissioner Lawrence B. Gibbs Jr. In 1986, 27,000 of about 860,000 tax-exempt groups reported unrelated business income in excess $1,000, or total revenue over $25,000.

Of more than 3,000 tax-exempt groups audited in 1986, 37 percent had not properly reported their business income, although not all were found to owe tax for unrelated business income, Gibbs said.