In the complex human equation that produces a turncoat, rarely is only one motive at play. But different periods have featured different motives in the ascendancy.

The first great wave was ideology, growing from an early fascination with the Soviet experiment, which promised freedom from the grinding inequities of capitalism. Julius Rosenberg, for instance, whose parents worked in New York City sweatshops, joined the Young Communist League as a teenager; he was one of dozens of American and British Communists who fed secrets to Soviet intelligence in the first half of the 20th century.

But by the 1970s, disillusionment with the crimes of Communism meant that few took up the Soviet cause gratis. Money dominated the second wave: hundreds of thousands of dollars for the spy ring led by John A. Walker Jr., a Navy warrant officer; $4.6 million for Aldrich Ames of the C.I.A.; $1.4 million for Robert P. Hanssen of the F.B.I., who once sent his handler a note seeking diamonds, saying cash was harder to hide.

Perhaps no would-be spy was so indiscriminately mercenary as Brian P. Regan, an Air Force master sergeant who worked at the National Reconnaissance Office, overseer of spy satellites, and was sentenced to life in prison in 2003 after seeking to sell secrets to Iraq, Libya and China.

The third wave of spying shows much less greed. Money, the sole or primary motive for two-thirds of spies who got their start in the 1980s, was the main draw for just a quarter of spies from 1990 to date, Ms. Herbig’s new analysis concludes. No money at all was paid in the 11 most recent cases.

The largest share was made up of naturalized Americans who spied out of devotion to another country: Cuba, the Philippines, South Korea, Egypt, Iraq. In a handful of cases, Muslims have been accused of ties to Al Qaeda or other terrorist groups; these include Hassan Abujihaad, an American convert to Islam convicted last month of supplying information on Navy ships to a suspected terrorist financier.

Then there is the rash of Chinese cases, notably that of Mr. Mak. Prosecutors called him a classic “sleeper” agent who worked for years in technical jobs before delivering military information to China, including three encrypted computer disks of data. Still, such cases seem murkier than those with a money trail. Mr. Mak, as well as his friends and some Chinese-Americans, argue that his prosecution reflected anti-Chinese paranoia. They noted that the information he provided was unclassified and had been presented at international conferences.