In the Settings menu from the main menu in Terraria, the Parallax option controls how much the background scrolls relative to the foreground. A setting of 0 (default) will have the background (which consists of sky, walls, etc.) scroll with the foreground (what you walk on and bump into etc.). A setting of 100 will scroll the background tiles at a high speed relative to the foreground tiles when walking left or right, giving the game a more prominent 3D effect.
Settings of 0-100 (inclusive) are available.
This effect is most noticeable underground when you can see the dirt backgrounds scrolling when you move and have parallax set high.