We left the children of Israel wandering in the desert (would have been around 1,200 BCE), making their way to the Promised Land, the land Yahweh is “giving” them (always read the fine print, “giving” meant, “go in and conquer and I’ll be there to help”).
Moses does a second rock trick to get water for the people but this time not in a way Yahweh approves, so Yahweh says, Bud, you can look at Canaan from the top of a mountain but you ain’t a’gittin’ in. A reminder of who actually holds the power, I guess. Confusing story. More here.