The keyboard has basically been divided into four parts, that hinge together. Unfolded, these four parts lie next to each other. Folded, these four parts lie on top of each other. That's the basic idea. But the execution is soo smart.
Every little thing has a function.
The folding design actually consist of six parts, not four. The middle hinge is a simple a hinge. The left and right hinges are actually two small sections. The underside of these two small sections, together with the underside of the left and right keyboard sections, form the outside of the case when the keyboard is folded up. In its folded state, all the keys are pressed together, but you need not worry about the keyboard unfolding accidentally.