“When Ralph came up, we were chasing footballs,” said Robert Garris Jr., who is black and a friend from childhood. “We were chasing basketballs, baseballs. We were fishing. We were crabbing. We didn’t see race.”

Many people are now wondering how this same Ralph Northam, now the governor of Virginia, could be the man who ended up with a racist photograph on his page in a medical-school yearbook. How he could have thought it a good idea to darken his face with shoe polish to moonwalk like Michael Jackson in a contest in the early 1980s. How he could have been unaware of the deep and resonant pain associated with blackface among the African-Americans he represents, until a staffer told him about it during his most recent campaign.

As Mr. Northam, Virginia and the national political establishment grapple with what’s next for him, an examination of his early life in the secluded, rural fishing town of Onancock, Va., provides some clues about what shaped his perspectives on race, and how he could have fallen so short in his understanding.

Though classmates from medical school and many people outside of Onancock are calling on him to resign, many of those who know him well from his hometown are pushing back against demands that he step down.