Flexibility is important for software organizations to cope with changes demanded in the business environment. So far, flexibility has been extensively studied from a software product and software development process point of view. However, there is little work on how to build flexibility at the level of the whole software organization. Thus, there is no clear understanding of how to effectively improve the ability of an organization to respond to changes in a timely fashion and with little effort. This paper presents the results of a grounded theory study on how flexibility is built and improved in an IT organization and provides a holistic and explanatory view of how this is achieved. Implications for research and practices are also provided.