FEMA’s public assistance program is among the largest in a menu of post-disaster programs overseen by several federal agencies. It has grown substantially more costly over time. From 1992 through mid-September, it paid for 683,035 separate projects — removing debris after natural disasters (mostly hurricanes and floods) and repairing and reconstructing public buildings, roads, bridges and utilities — according to a computer analysis of agency data by The Times. More was spent on public assistance during that period than on reimbursements by FEMA’s better-known National Flood Insurance Program, which covers losses by homeowners and businesses.

Grants have gone to every state and territory, with New York and Louisiana the biggest recipients because of Hurricane Sandy in 2012 and Hurricanes Katrina and Rita in 2005. About a fourth of the money has been used to repair and replace public buildings.

In most instances, grants cover at least 75 percent of the cost to return a damaged building to its prior state while also complying with current codes. If the cost of repair is more than half that of replacement, FEMA will pay to build anew. The program also provides grants for hazard mitigation to minimize future damage.

When structures in designated flood plains are rebuilt or repaired, FEMA requires that they be elevated to at least the 100-year flood level — high enough, that is, to withstand a storm with only a 1 percent chance of occurring in a year. Buildings that serve a critical function, like hospitals or power plants, must be raised to the 500-year level.

The agency can pay to relocate destroyed buildings if it is deemed cost-effective, but it often isn’t. In New York City, FEMA spent more than $700 million — with the city pitching in $80 million more — to repair 72 schools damaged during Sandy. But the city’s high cost of real estate and construction dictated that only one would be moved, to an adjacent site where it will be elevated, according to the Mayor’s Office of Recovery and Resiliency.

Instead, the money was spent on measures that accepted the inevitability of future flooding, like raising vents, relocating electrical systems to rooftops and replacing drywall with building materials that could be easily dried and disinfected.