If you remember watching cartoons as a child, you'll probably recall those chase sequences, where the seemingly endless background - kitchen or hallway, forest or hill - blurred by repeatedly as the foreground characters rushed back and forth. It was a simple technique, but it worked, and it's still being used today.
The old-school mechanical task of literally 'scrolling' a large background drawing has now been superseded by more powerful software-based techniques. Today, it's possible to create each element in the animation on its own layer and animate it independently. This in turn frees up the producer to explore more advanced techniques, to make the loops seamlessly randomised. And the layered editing environment also makes it easier to add a sense of depth to the animation - multiple layers of scenery all scrolling past at different speeds to mimic the effects of parallax, for instance.