Opened flour bags harden over time due to moisture absorption from the air, which causes the gluten in the flour to develop and clump together. Proper storage in an airtight container can prevent this.
Flour is hygroscopic, meaning it readily absorbs moisture from its surrounding environment. When a bag of flour is opened, it's exposed to the humidity in the air. This moisture interacts with the proteins, primarily gluten, in the flour. Gluten is what gives dough its elasticity and structure. As the flour absorbs moisture, the gluten proteins begin to hydrate and bond together, forming larger clumps. Over time, this clumping effect leads to the flour hardening and becoming less free-flowing. The higher the humidity and the longer the flour is exposed, the more pronounced this hardening effect will be. Different types of flour have varying protein contents, which can influence how quickly they harden. For example, bread flour, with its higher gluten content, might harden more noticeably than cake flour.
To prevent flour from hardening, transfer it to an airtight container immediately after opening the bag. A container with a tight-fitting lid will minimize moisture absorption and keep your flour fresh for longer. Consider adding a desiccant packet for extra protection in very humid environments.