When the Moon was forming, it had the Lava all around the surface as volcanos kept spitting it out. The same Lava later got cool and formed the cavities or the caves, that could shelter the astronauts on future missions, says NASA. The Lunar caves are suitable for the astronauts to spend some time on the Moon inside the caves, instead of spending the time in the space capsule. As the caves are deep and strong, they are useful to prevent any UV Radiation hitting the astronauts.
The ancient Lava on a lunar surface made these caves, that might be useful for humanity on the future lunar missions. NASA claimed the same in Reddit Q&A, where Reddit users asked a question to NASA in an open Ask me Anything task. The Lava caves will work as the natural shelter for the astronauts and also it will provide a temporary base station for performing scientific experiments. When Lava flew on the surface of Moon, it formed the long tube-shaped tunnels when it hardened out, making it the best possible structure for taking shelter. Instead of building an artificial base on Moon, the astronauts can take benefit of the natural structures.
The caves will protect from fluctuating temperatures of the Moon and also from the harmful UV radiation, that is what the astronauts are worried about the most. Currently, US Space Agency NASA is working on the lunar mission that is supposed to launch in 2024. The Reddit AMA session was all about the questions on the mission. The team of scientists answered the questions of all of the redditors. According to the team, these lava tubes or the caves are not the only natural location for the astronauts to take shelter. But, they can land in the permanently shadowed craters, which have the flat surface.