Erno Rubik spent months fiddling with wooden and paper cubes, fastened together with rubber bands, glue, and paper clips until he came up with what he named the “Bűvös kocka,” or Magic Cube. The Rubik's Cube Inventor's breakthrough came when he realized that the puzzle could be solved by focusing on one face at a time.
This is what the first ever Rubiks Cube looked like.
Nowdays its much more complicated.
Each of the six centre pieces pivots on a fastener held by the centre piece, a "3D cross". A spring between each fastener and its corresponding piece tensions the piece inward, so that collectively, the whole assembly remains compact but can still be easily manipulated. The moves that one can perform on Rubik's cube form a mathematical structure called a group. One can solve Rubik's cube using two basic ideas from group theory: commutators and conjugation.
Commutators and conjugates are very simple ways of building sequences of moves that can, for example, permute pieces or orientate them.
How do commutators work?
The commutator reverses the current flow within a winding when the shaft turns. Once the shaft completes a half-turn, the windings are connected so that current supplies through it in the reverse of the first direction.
How do conjugates work?
Conjugates are based upon a 'setup' move A and its inverse A' which you apply before and after any other algorithm. In general, A B A', where B is also an algorithm. A conjugate is the perfect tool you need if you have come up with a commutator.