Silica gel sachets take up moisture. That is the whole function, and it is worth stating because they are constantly confused with oxygen absorbers, which sit in the same drawer and do a completely different job.
Oxygen absorbers remove oxygen, which slows fats going rancid and stops insect eggs hatching.
Desiccants remove water vapour, which is what causes caking, clumping and mould.
They are not substitutes and using one where you needed the other achieves nothing. For most dry goods going into long storage the oxygen absorber is the more valuable of the two, because well-dried food sealed in a good barrier is not carrying much moisture to begin with.
Desiccant earns its place with things that are hygroscopic rather than merely dry: salt, sugar, milk powder, ground spices, anything that has previously gone solid in the cupboard. It is also worth having in a vehicle, where the daily temperature swing drives condensation that a house does not have.
Neither makes damp food safe. Adding a desiccant to something that is already too wet does not dry it to a shelf-stable state, and sealing it in an airless bag is actively the wrong move: vacuum packing and what it does not do.
Buy food-safe, indicating sachets if you can, so you can see when they are spent rather than guessing.