As Adeline says, this is as a result of moisture (most likely steam) getting into the dry ingredients!
There is nothing wrong with the powder, if I were you I'd just crumble it into your food/gravy jug as and when you need it.
In future (to answer the question in the title) there are a few things you can do to avoid this happening:
- Store in an airtight container
- Ensure you open said container away from running water and hot food and for as little time as possible
- Add something to the container to absorb excess moisture. Rice is traditionally used in salt shakers, but it's probably a bit small for stock powder so I'd suggest dried beans.
(FYI stock = broth and by gravy I mean the British kind)
I would not recommend using the silicon gel pads as someone else has unless they are certified as safe with food. Most contain toxic chemicals that may leach into the powder over time.