WASHINGTON — The spies are not particularly difficult to find. What is difficult is deciding what to do with them.

For more than 70 years, Moscow has filled its embassy and consulates in the United States with intelligence operatives — as Washington does with its own diplomatic outposts in Russia — giving them the mission of stealing the most significant secrets of a longtime adversary. It is the Federal Bureau of Investigation’s job to identify and track the operatives, part of a routine cat-and-mouse game.

But it is a rare and provocative act for the White House or the Kremlin to publicly expel diplomats, as the Obama administration did on Thursday. Current and former government officials described the delicate calculations, and no small amount of gamesmanship, that go into making such decisions.

Sometimes, American presidents decide to expel Russians who are thought to have done real damage with their espionage, and sometimes the expulsions are intended to send a warning shot to Moscow, with the expelled officials serving as pawns in a chess match.