You aren't too far off. the main reason for flaps is they create more lift and allow the plane to fly slower for takeoff and especially landing. But at a cost of higher drag, so they are retracted during cruise when the plane is flying fast and generates plenty of lift without them.
The flaps increase camber (and angle of attack) for more lift at slower speeds, such as takeoffs and landings. Cruise speeds are much faster than this, so the wing can generate the same lift with much less of an angle of diversion of the relative (to the wing) air flow, so the flaps are retracted.Hmmm. I see. So they move it to go fast because it would just make the airplane go slow?