Nephi later wrote that God “also gave [Moses] power that he should smite the rock and the water should come forth” (2 Nephi 25:20).
The typical explanation for this miracle is that Moses was familiar with this area, and knew that winter debris had clogged the exit of water from somewhere near the rock, and also knew that a good blow upon the rock would dislodge the debris and start the water flowing again. However, the people attributed this to the power of God (see footnote 1).
The Lord Led Israel Through the Wilderness
21 And the LORD went before them by day in a pillar of a cloud, to lead them the way; and by night in a pillar of fire, to give them light; to go by day and night:
22 He took not away the pillar of the cloud by day, nor the pillar of fire by night, from before the people. [Exodus 13:21–22]