How is a Rubik's Cube structured?

Ever wonder how a Rubik's Cube is designed to work the way it rotates no matter how you turn it? I had been trying to figure it out, although in the end I wasn't even sure if my complicated interpretation would actually work...

The answer is here.