The heater types reduce relative humidity by warming the air, but mainly, by making the guns a little warmer than ambient, they prevent condensation when you remove them from the cabinet.
The desiccant types work until they are saturated. Generally, the amount of humidity in a closed space rises as their water content increases, so you want to "recharge" them (actually not charging, but driving water back out in a low oven). Or you can just get some of the smectite clay (bentonite or montmorillonite) type of
granular oil absorbent or unscented and untreated kitty litter, spread it out on a cookie sheet and bake it for an hour at 450° or a little higher. While cooling, but still warm, drop it into an unwaxed plain brown paper bag, roll it up and put some rubber bands around it to keep it closed, and set it in the gun safe. This is what mil-spec desiccant is often made from. Moisture will permeate the paper bag just fine. This stuff has no color indicator, but a
cheap humidity meter or dropping a small commercial silica gel pack with color indicator into the box with it will tell you when the humidity is no longer being controlled. Below about 40% R.H. rusting is essentially impossible, but below 60% it has a much harder time starting. Besides, below 50% you can get into issues with oiled wood getting too dry.
A compressor type dehumidifier is best if you have room for it. It draws water out of the air by condensation on a cooled coil, then puts it intp a collection container or runs it down a drain. Much more trouble than the other stuff as it needs not only AC power, but a drain tube or regular emptying. This is the fastest type for drying wet air.