I have been in a fire like that (1200 homes burned down), and you can blame all sorts of factors for it, but the main culprits by far are:
Extremely dry conditions (Climate change) in areas that see very limited rainfall anyway.
High velocity winds that can carry embers for 5 miles (I have had them hitting my truck while escaping, so I know). With those kinds of winds, firefighting aircraft are grounded. Even if crews are brave enough to get in it's path and cut fire lines, it just jumps right over the lines.
We think the firefighters just jump right on the fire, but much of their efforts (Along with law enforcement) are to get people evacuated safely. That can be a major challenge. Roads are blocked, and clogged with cars, power lines down, missing people, etc...
Limited water from municipal systems that were originally designed for home use, not massive immediate demand, especially when power to pumps has to be cut due to downed power lines.
Dense vegetation (Chaparral) that has to be burned periodically, but that's a very complex issue. The governor signed into law legislation to increase prescribed burns five years ago, and they have tripled since it passed. But even so, there are many other hurdles. There are private property issues, Federal issues (Environmental Protection Agency, Endangered Species Act, Clean Air Act, and others) which can get tied up in courts.
Plus, many people don't want to look at voluntarily blackened areas (Prescribed burns) around their homes, even though they don't have a better solution. Even if you had the massive funds to go into all these canyons and yank out all the brush, what do you do with it?
In the end, as long as people build in risky areas, the perfect storm will happen sooner or later and as heartbreaking as it is, all you can do is learn from it, and try to minimize the risk in the future if they decide to stay.