A rubber band is an elastic material in nature. When stretched, it changes its shape and when the applied force is removed, it regains its original shape. That is why a rubber band changes its shape even though it is a solid.
If you stretch a rubber band, you pull those spaghetti-shaped molecules into a more or less straight line. So, the elastic quality of rubber comes from its interconnected spaghetti-shaped molecules, and from the tiny, random, jiggling motion of those molecules. That motion causes the molecules to resist straightening.