The reason behind this is very simple – hamsters, just like any other rodents, have ever-growing teeth. Thus, they’ll constantly need something to chew on. Another reason why your hamster might be biting the cage is fear or anxiety. These pets easily get scared and stressed out so they might be looking for a way out of the cage.
A good way to make your hamster focus on something else rather than biting the cage would be to feed it kibbles. Dry food is harder and will prevent your hamster’s teeth from overgrowing.