Flour clumps in closed plastic jars due to moisture absorption and compaction. Even small amounts of humidity can cause the flour particles to stick together, forming clumps.
Flour, being a hygroscopic substance, readily absorbs moisture from the surrounding environment. Even in a seemingly airtight plastic jar, trace amounts of moisture can still penetrate or be present within the jar itself. This moisture causes the starch molecules in the flour to hydrate and become sticky. As the flour sits, the weight of the flour above compacts the moist particles together, leading to the formation of clumps. The type of flour also plays a role; for example, cake flour, with its lower protein content, tends to clump more easily than bread flour. Temperature fluctuations can also exacerbate the problem, as condensation can form inside the jar.
To prevent flour from clumping, add a desiccant packet (like those found in vitamin bottles, but food-safe) or a bay leaf to the jar. These will help absorb any excess moisture and keep your flour free-flowing.