“I doubted what Indonesia now had to offer and wearied of being new all over again,” he wrote in his memoir. “More than that, I’d arrived at an unspoken pact with my grandparents: I could live with them and they’d leave me alone so long as I kept my trouble out of sight.” During those years, he was “engaged in a fitful interior struggle. I was trying to raise myself to be a black man in America.” Ms. Soetoro-Ng recalled her mother’s quandary. “She wanted him to be with her,” Ms. Soetoro-Ng said. But she added: “Although it was painful to be separated from him for his last four years of high school, she recognized that it was perhaps the best thing for him. And she had to go to Indonesia at that time.”

Image Ms. Soetoro during her field trip from 1988 to 1992. She died in 1995 of cancer. Credit... Courtesy of the Obama Family

That time apart was hard for both mother and son.

“She longed for him,” said Georgia McCauley, who became a friend of Ms. Soetoro in Jakarta. Barack spent summers and Christmas vacations with his mother; they communicated by letters, his illustrated with cartoons. Her first topic of conversation was always her son, her female friends said. As for him, he was grappling with questions of racial identity, alienation and belonging.

“There were certainly times in his life in those four years when he could have used her presence on a more daily basis,” Ms. Soetoro-Ng said. “But I think he did all right for himself.”

Fluent in Indonesian, Ms. Soetoro moved with Maya first to Yogyakarta, the center of Javanese handicrafts. A weaver in college, she was fascinated with what Ms. Soetoro-Ng calls “life’s gorgeous minutiae.” That interest inspired her study of village industries, which became the basis of her 1992 doctoral dissertation.

“She loved living in Java,” said Dr. Dewey, who recalled accompanying Ms. Soetoro to a metalworking village. “People said: ‘Hi! How are you?’ She said: ‘How’s your wife? Did your daughter have the baby?’ They were friends. Then she’d whip out her notebook and she’d say: ‘How many of you have electricity? Are you having trouble getting iron?’ ”

She became a consultant for the United States Agency for International Development on setting up a village credit program, then a Ford Foundation program officer in Jakarta specializing in women’s work. Later, she was a consultant in Pakistan, then joined Indonesia’s oldest bank to work on what is described as the world’s largest sustainable microfinance program, creating services like credit and savings for the poor.