Cup is a measure of volume, and grams is a measure of weight. Every food has a different density, so a cup is not always going to have the same weight.
When you put a snack like that into a measuring cup, the pieces don’t pack together very tightly, and most of the cup is actually filled with air, so you don’t need much weight of food to fill up a cup. Another example would be something like popcorn, which contains a lot of air and also does not tightly pack into a cup. Popcorn is around 8g per cup.