I can understand what function(s) the flaps serve, but how are they controlled from an internal perspective? Does flipping the switch send signals to an electrical servo? Or is it hydraulics? How are these devices attached to the main wing body, and if they use hinges (which they probably do) where do the hinges connect to? Do these devices have "Control Horns" and "Push-rods" like RC Planes? This can also be generalised to apply to ailerons and rudders too.
EDIT: I'm primarily referring to small GA planes like the C172 and the PA-28 - So while I'd like to hear about air-liners too, I primarily want to know about its implementation in GA aircraft.