caves are mostly formed on cliffs facing the ocean. If you go through in your head the conditions of that cliff it should help you answer this question. If the cliff is facing the ocean then waves will be hitting the cliff. Sea water contains bits of sand, and other sediment. As the wave hits the cliff face these bits of sand and sediment will smash up against the cliff forming cracks in the cliff face. over time more and more sand and sediment is smashed up against the cliff face causing the initial crack to get bigger and bigger. Over years and years this crack will become a hole which will become a bigger hole which will eventually become a cave. this process is called hydraulic action