THIS weekend, the Liberal Democrats, the party that has ruled Japan uninterruptedly for all but 18 months since 1946, will go through the ritual of electing a new president for a two-year term. Almost certainly, its choice will be Kiichi Miyazawa.Mr. Miyazawa's predecessor, Toshiki Kaifu, will then step down as prime minister and the parliament will elect a new prime minister - Miyazawa. The procedure is similar to that of Britain, where Margaret Thatcher was first voted out as leader of the Conservative Party and then succeeded as prime minister by John Major. The difference between Britain and Japan, however, is that Mrs. Thatcher was prime minister for more than 10 years before being overthrown by her own party. She led her party through two spectacularly victorious national elections. Had she been a bit more alert to rumblings among her backbenchers, she might have been looking forward to still another election triumph next year. During Thatcher's incumbency as prime minister, Germany and France had one change of leadership - from Helmut Schmidt to Helmut Kohl and from Valery Giscard d'Estaing to Francois Mitterand. In the United States, Carter gave way to Reagan, and Reagan to Bush. But in Japan, there has been a parade of six prime ministers, only one of whom - Yasuhiro Nakasone - lasted as long as five years. In 1987, when Mr. Nakasone stepped down, he had led his party to its greatest postwar electoral triumph only a year before. But Liberal Democrats, including Miyazawa, were already vying for the premiership, and Nakasone knew that the seemly way to preserve his power was to step down gracefully so as to exercise maximum leverage over the selection of his successor. Why are Japanese leaders politically so shortlived, when their Western counterparts enjoy relatively secure jobs? Most political analysts cite the Liberal Democrats' division into five competing factions, each of which insists on having its turn at the top job. The factions form shifting alliances among themselves, aimed at winning biennial elections for the presidency. Policy distinctions between them are minor. Some may be more hawkish on defense (Miyazawa is reputed to be dovish), or advocate tighter strings on the economy (here, Miyazawa may be more expansionist). But the factions' main function is money-raising for elections, which get more expensive year by year. An aspiring young Liberal Democrat must first join a faction - preferably a large and powerful one - to supplement his own fundraising and to guarantee him a ministerial portfolio once he has managed to be elected five or six times. In a society that makes a fetish of seeking consensus, a rotating premiership keeps factional competition and disputes from boiling over into open war. THATCHER, throughout her decade in power, had clearcut friends and foes within her own party. She rewarded her friends and constantly sought to cut the ground out from under her foes. In Japan, factions joust with each other. But as soon as the leadership battle is decided, every faction will expect to get a share of the spoils of office. Even the minor faction from which Kaifu comes has always been allocated at least one cabinet seat and frequently two. This longstanding system of rotating premierships seems suited to the Japanese temperament. But in an age of globetrotting leaders and annual Western summits, personal interaction counts for a lot in international relations. The longer a prime minister is in office, the more he or she can build the personal rapport that smooths the way when difficult or unpopular decisions must be made. It isn't just a matter of reaching a first-name basis with his American counterpart, as every Japanese prime minister has sought to do since Nakasone pioneered the Ron-Yasu routine with President Reagan. Rather, it's building a level of slippered comfortableness and trust that becomes intangible political capital, not only for the leader conc erned, but for his or her country. So far Nakasone is the only Japanese government chief to have cultivated this kind of international political capital. Despite his un-Japanese flamboyance, he managed to remain in office for five years. Miyazawa, who is a much better linguist than Nakasone and who will have his first head-of-government tete-a-tete with George Bush in Tokyo next month, is unlikely to get more than two. It's a pity his own party won't give him more time to make his a memorable prime ministership.