On the Moon they would be lava tubes almost certainly. No known water features on the Moon, so water formed caves seem unlikely, it probably never had seas or lakes, and the rocks are very dry compared to Earth. Which also fits with the idea that the Moon formed from the coalescing debris of a giant impact of a Mars sized embryo planet with the embryo Earth.
Are lots of them and would be useful places for humans to live in .
But - might be a bit more interesting than you'd think, because it's possible that some of them could be formed by impacts by fragments of comets - and so contain ice, like the Martian poles.
Many of them occur in the Tharsis region - low lying, and you get mists forming there - so - might be favourable conditions for ice to condense inside the caves on Mars. Page on caves.org
You could also have "fracture caves" caused by structural deformation of the rock - Mars hasn't had continental drift - but it does have the Valles Marineres - which is like continental drift just getting started - and a fair bit of volcanic activity.
Then - Mars has many water features as well, including rivers, deltas, from the past when it had abundant water at times.
The water was fast flowing and - there's now a picture emerging of lakes that get filled perhaps kms deep - and then catastrophic flooding from each crater to the next.
Combine that with layered deposits including deposits of salt - and seems even quite likely that Mars has many water carved caves.
But - they would be harder to spot from orbit than the lava tube caves. And you have dust dunes to cover up entrances also.
As far as I know, no water carved caves have yet been found on Mars. But expect we will find them eventually.
If so they would be great places -probably - to search for past life - as a way to get deep underground without drilling. And might also be another possible location for present day life.
If so - they are a challenge for robots to explore because you'd have no direct communication with the surface, but there is work on gong for ways to explore them. Life in Lava Tubes - Kinohi Institute, Inc.
Also Mars has dry ice features like these dry ice gullies
The gully marked with the arrow is newly formed between the time of the two photos. These gullies are thought to be a dry ice phenomenon on Mars. NASA Discovers New Gully on Mars (Photo)
If you can have dry ice gullies - can you also have dry ice caves?
Another type of cave we have on Earth, just possibly might have on Mars also - caves carved by sulfuric acid. Which on Earth also is a place where life can be found. Penny Boston who studies these caves has speculated about whether similar caves may occur on Mars and have life there. Cave Slime :: Astrobiology Magazine :: Search for Life in the Universe