During those discussions, Mr. Pompeo has relied on Andrew Kim, a Korean-American C.I.A. official who is in charge of the agency’s covert operations and analysis on North Korea. He was at Mr. Pompeo’s side when he traveled to Pyongyang, and on hand for Mr. Trump’s meeting with Kim Yong-chol in the Oval Office two weeks ago after the president had called off the planned meeting — a decision he quickly reversed.
North Korea’s motive for talking now, experts said, is linked to the progress it has made on its nuclear and ballistic missile programs. Having demonstrated the ability to strike the continental United States, the North believes it is in an advantageous position to strike a deal that would lift punishing sanctions.
There was also a determined campaign by South Korea, under the progressive government of Mr. Moon. When Kim Jong-un expressed a willingness in a New Year’s Day speech to send North Korean athletes to the Winter Olympics in the South Korean town of Pyeongchang, Mr. Moon seized on the moment to push for a broader diplomatic opening.
The Games ended up being a striking display of Korean unity. Afterward, Mr. Moon sent the director of South Korea’s National Intelligence Service, Suh Hoon, and his national security adviser, Chung Eui-yong, to Pyongyang to meet with Mr. Kim. At that meeting, they said, Mr. Kim extended an invitation to meet with Mr. Trump, which they conveyed to the president a few days later.
For all the role that spies played in arranging the summit meeting, it is hardly surprising that one of the earliest overtures came from an American investor with a history of doing deals in North Korea. Mr. Trump’s blossoming relationship with Mr. Kim seems as much a business proposition as a diplomatic overture.
In Singapore last week, Mr. Trump showed Mr. Kim a four-minute film that the American government had made, which depicted a thriving, modern future for North Korea, so long as it gave up its nuclear weapons. Mr. Trump enthused about the country’s idyllic beaches, which he said he could foresee being lined with luxury hotels and condominiums.
“Think of it from a real estate perspective,” Mr. Trump said.