Grain pests (worms, moths, etc.) are often in the packaged goods
at the store, and once introduced to your home are all but impossible to exterminate.
Airtight jars will only contain the pests within a single jar, not avoid them entirely.
If you're buying grain in large quantities, you can freeze it (in batches if necessary) for a day or so, after which you can keep it in those airtight jars. Large-scale de-pesting can be done with dry ice (floods the container with CO2 gas, asphixiating pests.
US-domestic / EU-domestic goods are generally fairly reliably moth-free. I've had issues with imported products from elsewhere.