Chief Justice John G. Roberts Jr. and Justice Samuel A. Alito Jr. have long been a jarring study in contrasts. The chief justice is guarded, embodying a cautious and conventional conception of the judicial role. Justice Alito, an eager combatant in the culture wars, tests the limits of that behavior.

Their differing approaches were on display in surreptitiously recorded comments at a Supreme Court gala last week.

Chief Justice Roberts struck a measured tone in response to efforts by a liberal operative to goad him into saying that there was “a role for the court” in “guiding us toward a more moral path.”

The chief justice responded: “Would you want me to be in charge of putting the nation on a more moral path? That’s for people we elect. That’s not for lawyers.”

Justice Alito, who can be awkward and aggrieved, seemed to take the bait, though what he said on the recording was little different from what he says in public speeches to conservative legal groups and at Catholic colleges.

“One side or the other is going to win,” he told the operative, Lauren Windsor, at an annual black-tie event for the Supreme Court Historical Society. “There can be a way of working, a way of living together peacefully, but it’s difficult, you know, because there are differences on fundamental things that really can’t be compromised.”