TOKYO -- The closer Japan and the United States move together, the more unhappy each becomes with the other. That is the paradox of relations between the two countries, the great "odd couple" of the western alliance, as they pass through the late 1980s.

There seems little chance things will change soon.

Two-way trade across the Pacific has mushroomed to $110 billion a year. Each country is hosting more of the other's citizens than ever before (half a million Japanese will visit the United States in July and August alone). Military cooperation has moved to new levels in the field and seems about to expand to research on the "Star Wars" antimissile program.

Yet in the United States, people increasingly view Japan as a predator bent on wiping out American industry and affluence with a bag of economic dirty tricks. In Japan, some people have a counterpart sentiment of the United States as a bully lashing out irrationally at a country that is guilty of nothing more than hard work and efficiency.

The discord is inevitable, given the fact that one of the great transitions of the post-war era is underway: Japan's emergence as world leader in many important fields of industry and services. Americans watch in astonishment as they run up enormous deficits in trade with Japan (almost $60 billion in 1986). So are Japanese, who not so many years ago dreamed of matching American companies' performance but thought they never would.

Americans now buy about a quarter of their cars and almost all the electronic amenities of modern life -- televisions, stereos, VCRs -- from Japanese companies. In a less visible but equally important trend, Japanese banks and investors are taking a pivotal role in the American economy, financing with recycled trade surplus dollars a good portion of the U.S. federal budget deficit and commercial loan market.

Japan also continues to be the cornerstone of America's military position in the region. About 50,000 U.S. service personnel are stationed at bases up and down the Japanese archipelago, operating planes and ships that can project U.S. power thousands of miles into the Pacific and Asian mainland. The crew of the USS Midway, the only U.S. aircraft carrier that actually is based abroad, has its home at the Yokosuka naval base south of Tokyo.

Japan depends on the United States too, though in fundamentally different ways.

Its economic appetite is increasingly compared by resentful Americans to a mother company's need for its colonies. The United States sells some manufactured goods here. But as a supplier, it is far more important to Japan as a breadbasket and strip mine. U.S. farmers provide food worth about $6 billion each year to Japanese tables. (Japan gets half its calories from abroad.)Much of the lumber, ore, coal and other basic commodities that keep the Japanese industrial machine moving also come from the United States.

So, of course, does much of the foreign money on which Japan's prosperity is ultimately based; well over one-third of Japan's $210 billion in export income last year came from sales to the United States. It is also the source of many of the technical discoveries that the Japanese have been so successful at commercializing.

The United States offers crucial military protection. In terms of portion of gross national product, Japan spends only about one-sixth of what the U.S. does on defense, and its armed forces operate under a hodgepodge of pacifist-inspired restrictions left from their defeat in World War II. The Americans augment Japan's conventional firepower and offer shelter under its "nuclear umbrella." That allows Japan to focus resources on economic development with greater security than it would otherwise enjoy, the Japanese concede.

U.S. Ambassador to Japan Mike Mansfield for years rarely gave a speech without mentioning "the most important bilateral relationship in the world -- bar none." Ties across the Pacific have grown to such a scale despite the fact that in size, history and fundamental attitudes of the citizenry, it is hard to imagine two countries more at odds with each other.

America is a new and eclectic nation of immigrants; Japan takes pride in being ancient and "one-race." America is geographically large and loaded with natural resources. Japan is small, a collection of islands, and has virtually no indigenous wealth beyond the industriousness of its people.

Moreover, Americans find it very difficult to form close friendships with Japanese as individuals.

Most westerners who live in Tokyo love its clean and safe streets, bustling dynamism and spit-and-polish efficiency. But the life that ordinary people lead here, with its demands for submission to society's conventions and devotion to duty, often seems to Americans repressive and ultimately unsatisfying.

The Japanese view westerners with mixed emotions too. Americans are admired for qualities ranging from taste in fashion to personal sincerity and creative genius in science. But American society as a whole is seen as lacking direction and discipline.

Ordinary Japanese, in fact, often have trouble understanding what "trade friction" is all about. As they see it, Japan is making the world a better place by shipping out low-cost, high-quality products on a scale never before seen in history. If Japanese products cause trouble in the United States or other countries, people here are occasionally heard to say, those countries should stop buying them.

From government policy makers and business leaders, the analysis is more sophisticated. But their basic message is that when Japanese industries best their American counterparts, they do it fairly. Closed markets in Japan are a factor, they concede, but the more important causes are that U.S. companies have grown lax on cost, marketing and product quality.

The Japanese see no contradiction in the fact that they would never allow foreign products to disrupt their economy on the scale that theirs have in the United States and other countries. Or that they would feel uneasy too if American investors were buying up Tokyo office towers the way Japanese are in Manhattan and downtown Los Angeles.

Attitudes like these, coupled with rising deficit figures, have helped build American frustration and today, tensions are on full boil. The United States has imposed punitive duties on some Japanese electronics products. The U.S. Congress is working on a trade bill aimed in large degree at Japan.

Tensions reached a new peak in early July when word broke that a subsidiary of the Toshiba Corp., the electronics giant, had illegally sold sophisticated ship-building equipment to the Soviet Union. American lawmakers responded by demolishing a Toshiba radio outside the Capitol building and raising a motion to enact a total ban on import of Toshiba products into the United States for at least two years.

With Washington demanding that the Japanese purchase American jets as the next-generation fighter for their air force, rather than building an all-new model, the bad blood of the trade relationship is spilling over into the military field, which for years had been almost trouble-free.

Yet, as angry as they may become, Americans would find the cost extremely high if they turned their backs on Japan. What could replace it as source for so many of the electronic conveniences they take for granted? Or the high-quality cars? Or the loaned dollars that close the deficit in the federal budget? Or the bases that provide a staging ground for regional military operations?

The Japanese face essentially the same reality. Periodically, someone here in a fit of frustration will talk about "turning east" to the Soviet Union. But everyone here knows that is no option at all. The Russians are historic enemies of Japan and abhorred by most people here. More importantly, they do not have the money to buy from Japan and make it prosper.

So Japan and the United States continue to stumble along in what is at times like a bad marriage. In both countries, pressure for retaliation against the other is tempered from the top. President Reagan has lobbied Congress against restrictive trade bills. When the White House does get tough, as it did with the electronics sanctions, it is often an attempt to head off a more severe measure being contemplated by Congress.

In Tokyo, each new set of demands from the United States for market concessions brings mumbled protests from various quarters that it is Japan that should get tough. But in the end, Prime Minister Yasuhiro Nakasone and his group of "internationalist" bureaucrats and politicians win out and come back with another attempt to buy off the Americans with concessions, or at least the appearances of them.

Many American officials concede today that Japan's tariffs on the average are lower than their own and that a great many of the formal bureaucratic barriers to imports have come down in recent years. Yet the trade deficit, as measured in dollars, has continued to grow, even with the 60 percent appreciation of the yen since 1985. The Japanese promise it will come down soon, and many American economists agree it will.

When that happens, it will likely remove much of the immediate pressure from Congress, which grows to a large extent from that single figure. Yet discord can be expected to continue as Japanese companies continue to displace American ones in world trade and Japanese investors buy up more and more of the United States' real estate, stock and government paper.

John Burgess has just completed three years as Washington Post bureau chief in Tokyo.