Penguins cannot fly because their stubby wings cannot support their bodies in flight. Scientists believe that penguins stopped flying when they became great swimmers, and their wings cannot be efficient at both things because swimming and flying require two different processes.
A 2013 study suggests that penguins lost their ability to fly by evolving an ability to swim. After studying birds that can both fly and dive into water, scientists found that these birds' wings created too much drag for the birds to be very effective in diving and swimming. Penguins, on the other hands, do not have this problem. They cannot fly, but their diving and swimming abilities are unsurpassed by other birds. For instance, a penguin can dive down to 1,500 feet in just moments.
Scientists studied several seabirds, such as the guillemot. It can both fly and dive, but the short wings that make it a champion at swimming make it a poor flier. It can barely stay aloft.
Penguins' major source of food is fish, which requires them to spend most of their time in the water. It became expedient that they evolve to become better fishers. Their wings shortened over time, and their light bones became dense to help with diving.