God wants us to ask for His help. Some folks refuse to ask God's help, even when they realize that they need Him. God never forces Himself upon us, but He longs for us to call upon Him. When David realized how much he needed God's help, he was not too proud to cry out. He was honest enough to learn from God.
Pride is a hinderance to learning.
And we must be in subjection to our teacher. The cave experience was a training ground for David. Before he could learn the things God wanted to teach him he had to be humbled. David learned his lessons well. God was at work chipping away at all that was in David's life which would hinder him from being the kind of king that the nation of Israel needed.