Humidity is the enemy of ground spices like garlic powder and onion powder. Once moisture gets in, they turn into a solid rock.
The Rice Trick
Add a few grains of raw rice to your spice jar. The rice will absorb any excess moisture before the spice can, acting as a natural desiccant.
The Toaster Oven Save
If a spice has already clumped, spread it on a baking sheet and place it in a very low oven (or a toaster oven that was just turned off) for 5-10 minutes. The dry heat will pull the moisture out, allowing you to crush it back into powder.