Sometimes a presidential visit following a disaster is intended as a call to action. Other times it amounts to a kind of apology, aimed at rebutting the impression that the federal government has failed in its response.

These days it has become a standard part of just about every natural calamity to befall the United States. President Obama in recent years has visited the sites of hurricanes, tornadoes and a devastating mudslide in Washington state. On Tuesday, Air Force One will touch down in Baton Rouge, La., where epic flooding caused the country’s worst natural disaster since Hurricane Sandy in 2012.

Why has a presidential visit become such a standard part of the federal government’s response? The main benefit is to rally support and bring in donations at a time when media attention can be fleeting.

“A visit from the president shines a light on the situation,” said Andrew Card, a top official in both Bush administrations. “He brings the national media. He brings attention. Americans are great at responding to a tragedy if they know about it.”

Just about every presidential trip carries with it an element of politics. Obama’s visit to Louisiana follows a stopover by Republican nominee Donald Trump, who slammed the president last week for not cutting short his Martha’s Vineyard vacation to deal with the damage. The White House announced Tuesday’s visit as Trump was touring the flood-damaged area Friday.

Obama’s trips to disaster areas, though, have tended to focus on the business of drumming up donations and managing the dynamics of the federal response.

“If I’ve got one message for folks here today, it is go online and donate,” Obama said in 2013 after tornadoes blew through Moore, Okla.

On Staten Island, in the wake of Hurricane Sandy, he called for federal, state and local officials to work together. “We’re going to have to put some of the turf battles aside,” he warned.

American presidents have for decades turned up at the sites of the biggest natural disasters. President Richard M. Nixon visited Mississippi in the wake of Hurricane Camille. President George H.W. Bush surveyed the damage from Hurricane Hugo in 1989 and was on-site just days after Hurricane Andrew swept through South Florida, killing dozens and causing more than $25 billion in damage. Federal assets were also set aside so that Bill Clinton, then the Democratic nominee, could make the trip, Card said.

Until recently, though, smaller natural disasters typically fell to vice presidents and their staffs. “We would joke we would go to funerals and disasters,” said Joseph Hagin, who worked as then-Vice President George H.W. Bush’s personal aide in the Reagan administration.

Compared with the president, the vice president brings a relatively light logistical footprint — a smaller plane, motorcade and traveling press contingent — all of which place fewer demands on locals when resources are stretched thin. Vice President Biden, for example, visited Scranton, Pa., and Colorado when those areas were hit by flooding; Obama did not. And it was Biden, not Obama, who attended a memorial service for the 19 firefighters who died battling the Yarnell Hill Fire in Arizona.

Increasingly, though, Americans expect their president to visit. Some of that change can be traced to George W. Bush’s decision not to visit New Orleans in the immediate aftermath of Hurricane Katrina.

At the time, Bush was returning to the White House from a vacation in Texas, and White House officials decided to fly low over the flood-ravaged city. A photograph of the president looking out the window of his jet became a symbol of his administration’s neglect.

“People asked, ‘Why didn’t he stop?’ The reason was that it would have diverted critical resources from the search-and-rescue effort,” said Card, who served as White House chief of staff.

Other Bush administration officials said that a presidential stopover would have required assistance from Coast Guard rescue helicopters and probably would have cost lives. “Those same helicopters . . . would have been pulling people off rooftops,” said Steve Atkiss, a special assistant for operations in the Bush administration.

The Katrina aftermath unquestionably made it harder for presidents to stay away from natural disasters, but demands for executive attention date back as far as the Calvin Coolidge administration.

“Your coming would center the eyes of the nation and the consequent publicity would result in securing millions of dollars of additional aid for sufferers,” the governor of Mississippi wired after the historic floods of 1927.

Instead, Coolidge dispatched Herbert Hoover, his commerce secretary, to lead the relief effort. To reassure an anxious public, Hoover was heard regularly on radio broadcasts, said David Greenberg, a historian at Rutgers University. “He made sure that people could hear a raging river in the background,” Greenberg said.