Birds are able to fly because of a variety of specialized adaptations. They have high metabolisms to supply their body with energy. They have lightweight bones. They have feathers, some of which are "flight feathers" that are long, strong, and able to produce lift and act as control surfaces. They also have a bone called the furcula, more commonly known as the "wishbone," in their chest, which is very important for being able to produce the strength and skeletal support needed to flap their wings.
The mechanics of flight are not unlike an airplane; the factors of lift, weight, thrust, and drag all interact to allow for controlled flight. By flapping their wings, birds create thrust and lift. They are able to steer by changing the shape and orientation of their wings and tail. They change the shape of their wing between the upstroke and downstroke as they flap to minimize drag on the upstroke and maximize the thrust generated downard on the downstroke, providing both lift and thrust. <><><> When all the feathers in a bird's wings are set in a certain way, so that the air cannot flow through them, the wing takes up a special shape which makes the air flow much faster over the top surface of the wing than it flows below the under-surface of the wing when the bird is gliding through the air. The difference in air-speed between the top and bottom surfaces of the wings gives the wings a "lift" force which can easily counteract the force of gravity.
Birds also have very powerful muscles to power their wings, which means they can flap their wings so fast that they can actually take off from the ground and move forward through the air, as well as glide "on" the air.
A very important fact is that a bird's wings are made of feathers. The feathers are not just ornaments! A bird can make its set of feathers close tightly together, which, when gliding or flapping, forces the air to flow around their top and bottom wing surfaces to give "lift", or it can make its set of feathers "open up", which allows the air to pass straight through them and, therefore, the wing, which allows the bird to fall under the force of gravity.
So, because a bird can set its wing feathers to be in any of a vast number of intermediate positions between "feathers fully open" and "feathers fully closed" - not just feathers fully closed for the start of a "flap" going to fully open before the end of a "flap", as would be necessary whilst flapping to take off - a bird can take off, glide, swoop down, glide again and then rise up again or drop, just as much as it wants to do!