On the south end of Scottsdale, Ariz., a low-slung, mostly windowless brick building sits back from the street between a Spanish colonial apartment complex and an upscale mobile home park. No sign tells the curious passerby what might lie within, yet the gleaming razor wire atop the surrounding wall raises unsavory possibilities. A guard is there to stop the curious, and if she fails, the device that pops out of the pavement and rips your tires to shreds will definitely succeed.

This is the operations center for the Salt River Project, one of the nation's largest municipal utilities. The executives and the clerks hang out at another building a couple miles away in Tempe, but this is where the real grid action goes down. When potential crises strike, operators here do their best to keep them from spreading. (SRP wasn't hit by the San Diego blackout, but since it operates the Palo Verde switchyard, it was peripherally involved.) Most of the time, though, technicians spend their time keeping power flowing to some 1 million customers in the Phoenix metro area from the utility's power generators, which range from shares in coal plants as far away as northern Colorado to small hydroelectric facilities on Scottsdale's canals.

You'd think the stress of keeping all those air conditioners running would wear on Mark Avery, SRP's grid manager. But he's fit, trim and looks no older than 50, with a full head of salt-and-pepper hair. When he tells me that he started his career as an operator trainee in 1974 at Navajo Generating Station in northern Arizona, I have to ask him to repeat himself.

Of all the baffling facts about the grid, perhaps the most mind-boggling, Avery tells me, is its constant need to be kept in balance. "The Western Grid is like a giant bucket," he says, "with a bunch of spouts running in and out, and you have to keep the water level constant." That is, the amount of electricity being fed into the Western grid by thousands of generators must always be equal to the load –– meaning the amount being used by its millions of customers. Lose the balance, and the frequency of the alternating current will drift away from the optimum 60 cycles per second, which could cause equipment to fail and result in outages. In the Western Grid, that balancing act is performed simultaneously by 38 different authorities; Avery and his colleagues oversee one of them.

Each day, using models based on weather forecasts and historical patterns, SRP's marketing team draws up a demand forecast for the following day, and schedules generation from SRP's own array of generators, (or from neighboring utilities if it's cheaper) to "follow" the demand curve. They also schedule plenty of extra backup power -- usually from fast-firing natural gas or oil "peaking" turbines -- to make up for forecast errors or to compensate for a downed power line or plant. The grid operators are then responsible for implementing the daily plan, and for tweaking it as it unfolds with hourly forecasts and scheduling. Over the course of the hour, they make up for energy imbalances -- or deviations from the plan -- by turning generation up or down. Minor, second-to-second bobbles are "regulated" automatically by software, typically by adjusting Hoover Dam's hydroelectric turbines.

Over time, this balancing act has become more and more challenging. Four decades ago, the greatest demand came from big industrial facilities like factories or mines that ran round-the-clock or on a set schedule. The generation sources were also steady and predictable, coming mostly from "baseload power" –– meaning coal or nuclear.

In the 1980s, the demand side of the equation began to change radically. As manufacturing moved overseas and people poured into the region, residential and commercial customers -- whose electricity demand curve has bigger daily ups and downs -- took up a larger share of overall demand. The air-conditioning revolution arrived at the same time: Between 1980 and 2009, the percentage of Western homes with air conditioning shot up dramatically, so that now there are more than 18 million homes with power-gulping cooling systems on the Western grid. On a summer's day in the desert Southwest, the overall electrical load at 5 p.m. can be twice what it was at 5 that morning, mostly due to the energy it takes to cool us all down; it can account for about 30 percent of total peak electricity demand in California or Arizona.

The new sources of power feeding into the grid are even less predictable. Solar and wind energy can swing up and down dramatically during a single hour. A massive dust storm or thunderheads moving in on a summer afternoon can cut production from a photovoltaic array by 80 or 90 percent in a matter of seconds. Wind-power swings are less violent, but can be huge: California's collective turbine output can vary by 3,000 megawatts or more over the course of a day, and by 100 megawatts in an hour. The greater the percentage of solar and wind in the mix, then, the greater the potential for errors in the day- and hour-ahead scheduling, and the more potential for imbalances, instability and outages.

"It's not the same kind of dispatchable, turn a lever, decide a day ahead what you're going to run the next day with any kind of certainty system that we're used to," says Brian Parsons, transmission and wind integration group manager at the National Renewable Energy Laboratories in Golden, Colo. Utilities typically respond to that uncertainty by adding two megawatts of natural gas backup capacity for every three megawatts of added wind power, chalking up the expense of building and operating the reserve to wind's "ancillary costs."

For Mark Avery, the variability is virtually a non-issue, because only about 3 percent of SRP's energy mix comes from solar and wind. But in California, where the state has required utilities to get 33 percent of their power from renewables by 2020, it's been a significant source of hand-wringing, as officials scramble to make sure they have enough reserves to cover wind and solar's variability. Fossil-fuel pushers regularly warn that replacing their steady plants with fickle solar and wind will plummet us all into darkness. They point to Germany, which now gets more than 20 percent of its power from non-hydroelectric renewables, primarily solar and wind. That has pushed the transmission system to "the brink of capacity," according to that grid's federal overseer, and renewables-caused voltage swings have resulted in machine malfunctions at Hamburg factories.

But is the problem really with renewables, or with the grid and the way it's run?