Beavers are ecosystem engineers. As a family moves into new territory, the rodents drop a large tree across a stream to begin a new dam, which creates a pond for their lodge. They cover it with sticks, mud and stones, usually working at night. As the water level rises behind the dam, it submerges the entrance to their lodge and protects the beavers from predators.

This pooling of water leads to a cascade of ecological changes. The pond nourishes young willows, aspens and other trees — prime beaver food — and provides a haven for fish that like slow-flowing water. The growth of grass and shrubs alongside the pond improves habitat for songbirds, deer and elk.

Moreover, because dams raise underground water levels, they increase water supplies and substantially lower the cost of pumping groundwater for farming.

And they help protect fish imperiled by rising water temperatures in rivers. The deep pools formed by beaver dams, with cooler water at the bottom, are “outstanding rearing habitat for juvenile coho salmon,” said Michael M. Pollock, a fish biologist with the National Oceanic and Atmospheric Administration in Seattle, who has studied the ecological effects of beaver dams for 20 years.

Restoration is not usually as simple as bringing beavers in; if left unchecked, they can do serious damage. Here in Butte, for example, beavers constantly dammed a creek where it ran through a culvert under a pedestrian walkway, flooding nearby homes and a park.

Enter the “beaver deceiver.” Beavers have evolved to respond to the sound of running water by trying to stop it, because their survival depends on a full pond. (A Yellowstone National Park biologist reported that when he briefly kept a beaver in his basement with plans to reintroduce it to a local stream, it kept frantically clawing at its cage to reach the sound of a flushing toilet.) So local officials installed the deceiver, a large wooden frame covered with stout metal mesh that blocks beavers’ access to the culvert but allows water to keep flowing. Even if they try to dam up the box, the water will still flow, and eventually they give up and move on.