Magnets! If you're still not sure how they work, then maybe you should check out this new video from Guru Games, the developers of the upcoming first-person puzzle game Magnetic: Cage Closed. It contains the first 15 minutes of gameplay, and reveals a bit more about where you are, and why you're horsing around with all these blocks and buttons.
The short answer to the latter question (and also the only one the video provides) is that if you don't, you'll die, although I expect the full game will dig deeper into that narrative element, much as Portal slowly revealed its secrets as it progressed. Other Portal similarities are quite obvious, including the use of cubes as a central component of gameplay and a menacing female voice urging the player forward. The "magnetic" angle also reminds me of Magrunner: Dark Pulse, and maybe it's just my imagination but I'm picking up a bit of a BioShock visual vibe, too.
Magnetic: Cage Closed is currently available for pre-order for a slight discount off the regular purchase price of $15. The launch happens on May 26.