Companies have reckoned with issues of race, class and gender for generations now.
On Feb. 1, 1960, four black college students sat down at the segregated lunch counter at a Woolworth's store in Greensboro, N.C. The civil rights sit-in movement was born, and five months later, Woolworth's desegregated.
Decades later, activists called on American companies to divest from apartheid South Africa. Under pressure, many big companies, including General Motors and Pepsi, pulled out of the country.
But for the most part, companies got political only under duress. Rarely have chief executives gone looking for a controversy. Instead, the prevailing view was one articulated by the economist Milton Friedman in The New York Times in 1970: "the social responsibility of business is to increase its profits."
By the 1990s, some corporate actors began taking the initiative. Apple, Disney and Xerox extended health care benefits to partners of gay and lesbian employees, helping to pave the way for broader acceptance of gay rights. Still, promoting inclusion and advancing diversity were hardly part of the curriculum for emerging titans of industry.
"When I went to business school, you didn't see anything like this," said Marc Benioff, the founder and chief executive of Salesforce. "Nobody talked about taking a stand or adopting a cause."
Now, Mr. Benioff is at the vanguard of a group of executives who are more connected — to customers, employees, investors and other business leaders — than ever before, and who are unafraid to use their influence.
In 2015, after Indiana passed a law that would have made it easier for religious conservatives to refuse service to gay people, Mr. Benioff canceled all Salesforce events in the state and threatened to relocate employees away from Indianapolis.
The outcry from Mr. Benioff and other business leaders helped force politicians, including Vice President Mike Pence, then the governor of Indiana, to reverse course. Ultimately, lawmakers passed a watered-down version of the law.
"C.E.O.s wield economic influence," Mr. Benioff said. "Nobody wanted to lose those jobs in Indiana. But we had to make a statement that we were going to withdraw if they were going to create laws that were going to discriminate against our employees."
The business community's triumph in Indiana emboldened progressive executives, and many have become more willing to confront controversial topics unprompted.
Randall Stephenson, the chief executive of AT&T, recently reflected on racial tensions in America at a meeting of 2,000 employees. "Black lives matter," Mr. Stephenson said, "we should not say, 'All lives matter,' to justify ignoring the real need for change."
Hamdi Ulukaya, the founder and chief executive of the yogurt maker Chobani, has hired hundreds of refugees — drawing the ire of the far right, but making him a cause célèbre for progressives.
And even before the showdown in Indiana, Timothy D. Cook, the chief executive of the world's largest company, Apple, came out as gay — the most prominent executive to make such an announcement. "I'm proud to be gay, and I consider being gay among the greatest gifts God has given me," he wrote.
None of this is to say that all corporate leaders are now beacons of morality. The Uber co-founder Travis Kalanick was ousted amid a mushrooming sexual abuse scandal at the company, and reports that he had cultivated a frat house culture. Martin Winterkorn, a chief executive of Volkswagen, resigned amid his company's emissions scandal.
But faced with circumstances they cannot in good conscience accept, more and more chieftains appear unafraid to act. In June, after the president withdrew the United States from the Paris climate accord, Elon Musk, the chief executive of Tesla, and Robert A. Iger, the chief of Disney, resigned from presidential advisory councils, setting the stage for this past week's revolt.
"The C.E.O.s of big public companies don't walk out onto the plank of social and political leadership by default," said Nancy Koehn, a historian at Harvard Business School. "But today, to keep silent is to jeopardize the reputation of the company."