Our job - let's call it programming - is very demanding and technical. But at the same time it is very much creative, i.e. it is rewarding for people eager to create something out of nothing. And this is the the most interesting part of our work to people like me at least. But this attitude also has a drawback. It is a negative impact on stability and morale. No one likes to fix bugs, write documentation and work with problems that are out of their control (like the customer's mood).
All these issues affect productivity a lot. And the only good motivator even for very self - motivated people is a good perspective. No perspective means no motivation. The combination of creativity, sense of duty and good perspective is unbeatable. Creativity is mostly genetics. Sense of duty is grown in humans during childhood by family, school and country.
The last part - a good perspective is a responsibility of manager.