In just four years, China has surged to become the second-largest supplier of military hardware to Thailand.

It now trails only the United States, which traditionally has supplied 70 percent of the country's needs.Analysts here say this sharp increase may be a onetime window of opportunity for the Chinese. Even so, military sales by the United States will be more difficult in the future and may never reach previous levels.

Diplomatic observers here believe the window opened because of the coincidence of several factors. They include a Thai military modernization program under tight budgetary constraints and a steep decline in U.S. military sales assistance.

The volume of Chinese military goods sold here may have exceeded U.S. supplies year-on-year, diplomatic sources told The Journal of Commerce. No hard Sino-Thai military sales figures are readily available.

Such figures would, in any case, underestimate the value, sources say,

because the Chinese sell at "friendship prices," perhaps even below cost.

China's new prominence as a source of military equipment for Thailand is even more remarkable because little more than a decade ago it was considered a potential threat by officials here.

Long after China stopped supporting a Communist-inclined insurgency here, relations remained cool. The 1979 Vietnamese invasion of Cambodia gave the two countries common strategic goals.

It was not until 1986, though, after a period of familiarization and confidence-building, that Thailand placed its first order with China.

Since then, there has been a wave of cash deals for tanks, armored personnel carriers and artillery. Most of the orders were placed in 1987 and 1988.

The Thai army made no big purchases last year although the navy ordered several Chinese frigates.

Thai military people say they are aware they were sacrificing quality for price. Westernsuppliers hope that as the Thais become more familiar with the trade-offs involved, they will return to the more reliable technology.

"As the Thais gain more experience with the quality or lack of quality of Chinese equipment, this will tend to color perceptions about whether to continue down this road," said one diplomatic source. "I think the cost- benefit analysis will change."

Others say that unless the equipment performs very poorly, China can expect to continue sales of lower-end technologies. Follow-up servicing - which for more sophisticated weapons systems can be more than two-thirds of the cost - will also be a factor.

U.S. foreign military assistance has fallen precipitously in the past few years. Thailand is one of the countries most affected by this.

Military sales assistance available and used by Thailand plunged to $22 million last year from $100 million in 1985.

The drop is a result of cuts induced by the Gramm-Rudman legislation and decisions by Congress to earmark increasing amounts of foreign aid.

China subsidizes the prices it offers to Thailand both to strengthen relations and to help unload the huge arms surplus it has accumulated with the demobilization of hundreds of thousands of soldiers from the People's Liberation Army.