Contrary to popular belief, birds flap their wings not to generate lift, but to generate thrust. There are 4 forces acting on a flying object (bird, plane, helicopter etc.): Lift `` , Gravity `` , Thrust `` , and drag `` . In the case of the bird, the bird's weight is the result of Gravity, Drag is the friction of the bird with the air, Lift comes from the shape of the bird wings, and birds flap their wings mainly to generate thrust.
How does the up and down motion of flapping wings generate thrust? You've fanned yourself with your hand, or a newspaper, or a handheld fan, haven't you? The breeze this motion generates is thrust, and the same happens when a bird flaps its wings. The wings push the air backward just like a hand fan, and that pushes the bird forward.
In addition, the flapping motion does generate some lift, but then the bird slightly dives which turns the gained altitude (potential energy) into speed (kinetic energy), and then the wings going through the air faster generates more lift than the flapping motion.