On one vessel, five people died on a very expensive excursion that was supposed to return them to the lives they knew. On the other, perhaps 500 people died just days earlier on a squalid and perilous voyage, fleeing poverty and violence in search of new lives.

After contact was lost with the five inside a submersible descending to the Titanic, multiple countries and private entities sent ships, planes and underwater drones to pursue a faint hope of rescue. That was far more effort than was made on behalf of the hundreds aboard a dangerously overcrowded, disabled fishing trawler off the Greek coast while there were still ample chances for rescue.

And it was the lost submersible, the Titan, that drew enormous attention from news organizations worldwide and their audiences, far more than the boat that sank in the Mediterranean and the Greek Coast Guard’s failure to help before it capsized.

The submersible accident, at the site of a shipwreck that has fascinated the public for more than a century, would have captivated people no matter what. But it occurred right after the tragedy in the Mediterranean, and the contrast between the two disasters, and how they were handled, has fueled a discussion around the world in which some see harsh realities about class and ethnicity.

Aboard the Titan were three wealthy businessmen — a white American, a white Briton and a Pakistani-British magnate — along with the billionaire’s 19-year-old son and a white French deep-sea explorer. Those on the fishing boat — as many as 750, officials have estimated, with barely 100 survivors — were migrants primarily from South Asia and the Middle East, trying to reach Europe.

“We saw how some lives are valued and some are not,” Judith Sunderland, acting deputy director for Europe at the group Human Rights Watch, said in an interview. And in looking at the treatment of migrants, she added, “We cannot avoid talking about racism and xenophobia.”

At a forum in Athens on Thursday, former President Barack Obama weighed in, saying of the submersible, “the fact that that’s gotten so much more attention than 700 people who sank, that’s an untenable situation.”

Status and race no doubt play a role in how the world responds to disasters, but there are other factors as well.

Other stories have been followed in minute detail by millions of people, even when those involved were neither wealthy nor white, like the boys trapped deep in a flooded cave in Thailand in 2018. Their plight, like that of the submersible passengers, was one-of-a-kind and brought days of suspense, while few people knew of the migrants until they had died.

And in study after study, people show more compassion for the individual victim who can be seen in vivid detail than for a seemingly faceless mass of people.

But the disparity in apparent concern shown for the migrants versus the submersible passengers prompted an unusually caustic backlash in online essays, social media posts and article comments.

Laleh Khalili, a professor who has taught about international politics and the Middle East at multiple British universities, wrote on Twitter that she felt sorry for the 19-year-old, but that “a libertarian billionaire ethos of ‘we are above all laws, including physics’ took the Titan down. And the unequal treatment of this and the migrant boat catastrophe is unspeakable.”

Many commenters said they could not muster concern — some even expressed a grim satisfaction — about the fates of people on the submersible who could afford to pay $250,000 apiece for a thrill. Before the U.S. Coast Guard said on Thursday that the vessel had imploded and the five were dead, jokes and the phrase “eat the rich” proliferated online.

That schadenfreude partly reflects the rising anger in recent years at economic inequality, at the wealthy themselves and at the growing sense that the economy works only for those at the top, said Jessica Gall Myrick, a communications professor at Pennsylvania State University, whose specialty is the psychology of how people use media.

“One of the functions of humor is it helps us bond with people socially, so people who laugh at your joke are on your team and those who don’t aren’t on your team,” she said in an interview. Expressions of anger, she said, can serve the same purpose.

For human rights advocates, their anger is directed not at the rich but at European governments whose attitudes toward migrants have hardened, not only doing little to help those in trouble at sea but actively turning them away, and even treating as criminals private citizens who try to rescue migrants.

“I understand why the submersible captured attention: It’s exciting, unprecedented, obviously connected to the most famous shipwreck in history,” said Ms. Sunderland, of Human Rights Watch. “I don’t think it was wrong to make every effort to save them. What I would like is to see no effort spared to save the Black and brown people drowning in the Mediterranean. Instead, European states are doing everything they can to avoid rescue.”

The chasm between the two tragedies was particularly noted in Pakistan, home to many of those who died on the fishing trawler, and to Shahzada Dawood, the tycoon aboard the Titan. It highlighted Pakistan’s extreme divide between the millions who live in poverty and the ultrarich, and the failure of multiple governments over many years to address unemployment, inflation and other economic woes.

“How can we complain about the Greek government? Our own government in Pakistan did not stop the agents from playing with the lives of our youth by luring them to travel on such dangerous routes,” said Muhammad Ayub, a farmer in Pakistan-administered Kashmir, whose younger brother was on the fishing vessel that capsized and is believed to have died.

One factor that made the two maritime disasters very different is the degree of familiarity — though that in no way explains the lack of effort to aid the migrants before their boat sank. It is not just that some people are indifferent to the suffering of migrants — it is also that migrant drownings in the Mediterranean have become tragically frequent.

The rescues of a few people in Turkey who had survived more than a week under the rubble of a powerful earthquake in February — unusual victories amid an unusual disaster — drew the kind of global attention rarely given to the millions of refugees from Syria’s civil war who, for a decade, have lived not far away.

In 2013, the deaths of more than 300 migrants in another boat disaster off the Italian island of Lampedusa produced an outpouring of concern and increased rescue patrols. When Syrian asylum seekers began trying to reach Europe in enormous numbers in 2015, some governments and people portrayed them as alien, undesirable, even dangerous, but there was also considerable interest and empathy. The wrenching image of a drowned 3-year-old washed up on a beach had an especially profound effect.

Years and countless migrant boat calamities later, the deaths are no less appalling but attract far less attention. Aid workers call it “compassion fatigue.” The political will to help, always spotty and precarious, has waned with it.

“No one cared about the several hundred people” who drowned in the Mediterranean, said Arshad Khan, a student of political science at the University of Karachi. “But,” he added, “the United States, the United Kingdom and all the global powers are busy finding the billionaire businessman who spent billions of rupees to view the wreckage of the Titanic in the sea.”

Reporting was contributed by Christina Goldbaum from London and Zia ur-Rehman from Karachi, Pakistan.