It picked up moisture in the jar
Updated
On this page5
The stock was dry when you filled it, the jar was sealed, and four weeks later the powder is damp. Nothing leaked. The water came in through a route people often never consider.
The jar is not a barrier by itself
A glass jar is impermeable. A plastic jar is not, and neither is most of what sits between the jar and the lid. Moisture moves through polyethylene, through an unlined closure and through the thread interface, slowly and continuously.
Over a week this is nothing. Over the six to twelve months a jar sits in somebody's cupboard it is the whole story.
The gradient does the work
The same mechanism that ruins a storeroom operates at the scale of a single jar. Where a temperature gradient exists, moisture migrates from warmer surroundings into the cooler dry product. A jar on a shelf above a hob, in a sunlit window, or on an outside wall is the cold dry thing in a warm damp neighborhood.
Which means some of this failure is not yours. But the share of it that is yours is the packaging you chose and the air you sealed in.
What the closure is actually for
Retention, not just containment. A lined closure with an appropriate liner material, or an induction seal, is a moisture barrier. A bare plastic cap on a plastic jar is a lid, and it will let the contents equilibrate with the room over months.
This is the point at which the container decision stops being about how it looks. The liner is a specification, and most suppliers publish it.
Testing your own packaging
Fill six jars as you normally would. Weigh them. Put two somewhere warm and humid, two somewhere normal, two somewhere cool and dry. Weigh them again at four weeks and twelve.
Weight gain is water. It costs you twelve jars and three months and it tells you more about your packaging than any datasheet, because it tests your closure, your fill room and your actual product together.