Exo 17:6 (ESV) Behold, I will stand before you there on the rock at Horeb, and you shall STRIKE THE ROCK, and water shall come out of it, and the people will drink.” And Moses did so, in the sight of the elders of Israel.
The walk with God is a walk of continuous discovery. He makes known His ways to His people, Psa 103:7 “He made known His ways to Moses, His acts to the children of Israel.” The difference between “ways” to be preferred over “acts” is because acts are limited and seasonal. God’s ways implies knowing that God has limitless ways of responding and in His time.
God demonstrates this to Moses who understood His ways. God was going to provide water in the desert in more ways than one. The Lord chose for this time to provide water by first having Moses strike the rock. Another time God had Moses speak to the rock, Num 20:8 “Take the staff, and assemble the congregation, you and Aaron your brother, and TELL THE ROCK before their eyes to yield its water …”
To hit the rock indicates that there are provisions God makes while we work with our hands. And to speak to the rock indicates there are others we pray through and leave it in His hands. In both ways of provisions, He gets the credit. God can do anything at any time using any means He chooses that men may hallow Him before men (Num 20:12).