In 1997, Philadelphia’s first four charter schools opened. Fifteen years later, there are more than 80 — and they’re straining the city’s public schools.

Philadelphia is one of several urban public school districts where the rise of charter schools poses a threat to district finances, according to Moody’s, the credit rating agency. In 2003, the Philadelphia district spent 7.9 percent of its general fund on charters. By fiscal 2012, the schools ate up 23.7 percent of the fund.

“While the vast majority of traditional public districts are managing through the rise of charter schools without a negative credit impact, a small but growing number face financial stress due to the movement of students to charters,” a team of analysts write in a new Moody’s report.

Three factors are at play: demographic and financial shifts, difficulty adapting and state policies. Here’s how each contributes:

1. Demographic and financial shifts

Charter school enrollment has been steadily rising as a share of total enrollment over the past decade or so. And urban school systems, especially in the Northeast and Midwest, are particularly affected by the trend.

Students enrolled in charters made up about one percent of total nationwide school enrollment in the 2000-2001 school year, according to data from the National Alliance for Public Charter Schools. This school year, they are estimated to account for 4.6 percent of total enrollment.

While charters are everywhere — in at least 41 states — they tend to make up a bigger share of total enrollment in urban areas. And some urban districts face a downward spiral driven by population declines. It begins with people leaving the city or district. Then revenue declines, leading to program and service cuts. The cuts lead parents to seek out alternatives, and charters capture more students. As enrollment shifts to charters, public districts lose more revenue, and that can lead to more cuts. Rinse, repeat.

2. Districts can’t adapt quickly.

Free-market advocates may not see the enrollment and revenue problems as a bad thing. If charters get more students and more funding, so be it. There’s one problem: It’s not a zero-sum trend.

The problem, Moody’s says, is that urban public school districts have trouble adapting. Parents, for one, can pressure districts to keep schools open. Even when they fail at that, as they did in Chicago, they can still stymie district plans. Despite that city’s effort to consolidate students there, thousands are shunning their newly assigned schools, the Chicago Tribune reports today. And unions can similarly stand in the way of quick changes, too.

And then there’s the very nature of the problem. Charter schools don’t suck up enrollment from just one school. They pull from schools across a district, meaning each takes a slight hit while none loses enough students to justify substantial restructuring.

“There is no critical mass of empty classrooms or schools,” the Moody’s report authors write.

In Philadelphia, cost-cutting began in fiscal 2011, but it wasn’t until this year that a significant number of schools were closed.

3. State policies support charter schools.

State policy can dictate not only who can authorize a new charter school, but the pace at which they grow.

Colorado, Florida, and Washington, D.C., give broad powers to authorize new charters while not limiting enrollment, for example. As a result, charters account for more than a tenth of student enrollment in ten Colorado districts and five Florida ones. In the 2011 to 2012 school year, 41 percent of D.C. students attended a charter.

About 20 states limit the number or type of charter schools, according to Moody’s. But that’s no guarantee that districts will be insulated from flight to charters. In Ohio, for example, students in charter schools account for more than 20 percent of total enrollment in five districts, even though state policy limits the pace of charter-school growth. But the impact varies by district. A Columbus district fares well thanks to stable demographics, while districts in Cleveland and Toledo are struggling in the face of population declines.

And there is no one policy that can protect (or harm) public school districts. In Colorado, where charter enrollment is high and uncapped, public school districts are faring relatively well, according to Moody’s. That’s thanks to demographics — the population has remained stable — and state laws that give public schools more flexibility with how funding is distributed and allows them to use taxes to support charter schools.

Michigan and Pennsylvania fund charter schools differently, but both have districts under credit pressure. In Michigan, charters don’t get a cut of local revenue for the students they enroll. In Pennsylvania, they do.