Why was Elijah sitting in a cave on Horeb, the mountain of God? It was all because of Jezebel, the pagan queen of Israel and her prophets of Baal.
Elijah had challenged 450 prophets of Baal to a sacrificial duel at Mt. Carmel. Both he and they were to place on wood a young bull prepared for sacrifice but light no fire. Instead both were to call upon their god. Whichever god answered with fire would be declared the winner and worthy of worship. The prophets of Baal spent hours calling him and received no answer. Elijah mocked them and their god/ saying perhaps he’s asleep or meditating or on a journey or retired. They continued calling. “But there was not a sound; no one answered, and no one was listening.” Now it was Elijah’s turn. He built a stone altar, dug a trench around it, put the pieces of the young bull on the wood, and ordered four jars of water to be poured over the holocaust not once, not twice, but three times to ensure it was soaked. What chutzpah! He called upon the Lord and the Lord answered with fire which consumed the sacrifice, the wood, the stones of the altar, the dust, and even the water in the trench! I think he probably thought “Thank you, God.” He then killed all the prophets of Baal. Now this did not sit well with Jezebel who swore to have Elijah killed in the same manner. Of course Elijah escaped to the desert and prayed for death at the hands of the Lord. But an angel of the Lord strengthened him with food and water and he made his way to Horeb, walking 40 days and 40 nights. And that’s why he was in that cave when he heard the command to go outside and stand before the Lord.