Coriander seeds become soft in glass jars due to moisture absorption from the surrounding air, as glass jars are not completely airtight and temperature fluctuations can cause condensation inside the jar.
Coriander seeds, like many spices, are hygroscopic, meaning they readily absorb moisture from the environment. While glass jars provide a decent level of protection, they are not perfectly airtight. Over time, even small amounts of moisture can seep into the jar. Temperature fluctuations also play a role. When the temperature drops, the air inside the jar can reach its dew point, leading to condensation on the inside of the glass. This condensation then gets absorbed by the coriander seeds, causing them to soften and lose their characteristic crunch and flavor. The higher the humidity in your environment, the faster this process will occur. Furthermore, if the coriander seeds weren't completely dry when initially stored, the residual moisture within them can contribute to the softening process.
To prevent coriander seeds from softening, store them in airtight containers made of plastic or metal, and consider adding a food-safe desiccant packet to absorb any excess moisture. Store the container in a cool, dark, and dry place, away from direct sunlight and heat sources.