The circuitry behind this is fairly simple. It relies on the principle that the default state of a Redstone Torch is on, and that when power is applied to the block that it is mounted on, it will turn off. When no power is applied to the bottom block in the circuit, the bottom and top Redstone Torches are on, and the middle is off, because the bottom one is powering the block the middle one is attached to.
The bottom piston is on because the bottom Redstone Torch is powering it. The middle piston is also on, because the bottom Redstone Torch is powering the cobblestone directly above it, also powering the piston adjacent. The top piston is on because the top Redstone Torch is powering it.
When a current is applied to the bottom block of cobblestone, the bottom Redstone Torch is turned off, because it is mounted on the cobblestone. This makes the bottom piston retract. Because no power is being applied to the middle cobblestone block, the middle piston turns off, and the middle Redstone Torch also turns on (because power isn't being applied to it anymore). This, in turn, turns off the top Redstone Torch (because power is being applied to the cobblestone block it is mounted on), turning the top piston off.
And yes, this design can be repeated upwards infinitely (but there will be a noticeable delay between the topmost and bottommost pistons, as it takes time for each Redstone Torch to change states).