Scientists have finally revealed how the little, black flies of Mono Lake are able to keep themselves dry underwater and survive in the highly alkaline water of the lake.

The vast Mono Lake lies east of Yosemite National Park in California and is one of the most ancient lakes in North America. This 150-foot-deep lake is believed to be about 760,000 years old. It also serves as a stopover point for millions of migrating birds each year—including California gulls.

Mono Lake is known for its highly alkaline water, which is said to be about three times as salty as the Pacific Ocean. The lake has no outlet, which means its water has continued to build up high salinity levels, making it rich in carbonate content. No fish can live in this highly alkaline water, and only brine shrimp and photosynthetic algae are known to survive in the water of this lake.

My newest for @Gizmodo! The alkali fly can “scuba dive” into Mono Lake, then pop up to the surface perfectly dry. Now, scientists have figured out how it pulls this magic trick off. https://t.co/r9kDD2BhcK — Jake Buehler (@buehlersciwri) November 20, 2017

However, Mono Lake is home to a bizarre alkali fly, scientifically known as Ephydra hians, which has perplexed researchers for decades with its unusual behavior. A large population of these flies inhabits the lake’s shores, peaking around summer period, when around 100 million alkali flies could be living near the lake.

The unusual feature of these flies is that they can easily stay for up to 15 minutes (about 20 feet deep) in the alkaline water of the lake, and even lay eggs within the water. According to researchers, these alkali flies have evolved themselves over millions of years to be much hairier and waxier. Researchers say these flies have 36% more hair on their bodies compared to other flies. These short, bristly hairs are coated with a waxy substance, which repel water and help keep the body of the fly dry. Moreover, when these flies go deep in water, the hairs create a complete air bubble around the body, acting as an external lung, and allowing the flies to breathe with complete ease.

Alkali flies in California’s Mono Lake use special adaptations to dive underwater without getting wet. pic.twitter.com/rXkVVxHppn — Scientific American (@sciam) November 20, 2017

The research was carried out by Floris van Breugel, a postdoctoral candidate at the University of Washington. Breugel was offered a grant by National Geographic Society Committee for Exploration and Research to study the odd behavior of flies at Mono Lake.

“Because of these tiny adaptations, the alkali flies are able to occupy a niche that very few other animals can tolerate,” van Breugel said.

Breugel and his team members captured the activity and movement of the flies using high-speed video cameras. They also tested the activity of related species of flies in the Mono Lake water, and found that other flies got trapped in the lake water after becoming wet and eventually died.

“It’s just a killer gig. There’s nothing underwater to eat you and you have all the food you want,” said Professor Michael Dickinson, a fly researcher at the California Institute of Technology and one of the study’s co-authors.

The detailed findings of the study were published in the journal Proceedings of the National Academy of Sciences.