Flaps are one of the most ingenious parts of the plane, and to most people, how they work is an utter mystery. The problem lies in that from the cabin, you can't really see what is really going on with the flaps when extended.
Most people think that it is a way to extend the wing so that it provides more lift (and drag because of the extra area) both granting more control during landings, and more lift during takeoff. That's baloney. Here's what's really going on.
The flaps are actually just support structures for a few cages. The cages hang from the flaps, and house a family of ducks, and we all know that ducks are the absolute best fliers in the world. On takeoff, these ducks use their highly efficient wings to give the plane a bit of extra lift at slow speed. You'd be surprised just how well mother nature does compared to the best of the best from Seattle and Toulouse. Nothing beats a duck for getting a plane in the air. Unfortunately, it's cold up in the air, and the ducks would freeze to death if not sheltered. So, shortly after takeoff, the flaps are retracted pulling the ducks in to a heated holding area where they are fed and kept away from the bitter cold.
Upon descent, the flaps are engaged again, and the ducks come out to aid the pilot in controlling the plane. You see, airplane wings don't do so well at low speeds as they do at higher speeds. No worries, because the duck is also the most graceful flier in the world. The ducks guide the plane to the runway at very high precision and flare at just the right time to give you a smooth landing. Again, to protect the ducks from the elements like poor air quality on the ground, the flaps may be retracted again as the plane taxis to the gate bringing the ducks out of harms way.
So, you can attribute the marvelous flying behavior of today's modern jetliners to the remarkable flying skills of the duck.
(Don't believe a word of this. It is just for fun. )