WASHINGTON — As Justice Lewis F. Powell Jr. was struggling with how to cast the decisive vote in a 1986 Supreme Court case that would end up devastating the gay rights movement, he told his fellow justices that he had never met a homosexual.

In truth, one of his four law clerks that term was gay.

The atmosphere at the court today is far different from 1986, with a pace of change that may have surpassed that in the rest of society. Openly gay law clerks are now common in the chambers of both liberal and conservative justices. In January, Chief Justice John G. Roberts Jr. formally admitted about 30 members of the National LGBT Bar Association to the Supreme Court’s bar.

As the justices consider two major cases on same-sex marriage, with decisions expected this month, they are, of course, focused on legal issues. But students of the court say other factors may also play a role.

“In addressing for the first time whether the law must recognize lesbian and gay couples as families,” said David C. Codell, who served as a law clerk to Justice Ruth Bader Ginsburg, “certain of the justices undoubtedly will reflect upon their real-world experiences of getting to know and to understand lesbian and gay people as individuals and as members of families.”