From the desert of Sin the whole Israelite community journeyed by stages, as the LORD directed, and encamped at Rephidim. Here there was no water for the people to drink.
They quarreled, therefore, with Moses and said, "Give us water to drink."
Moses replied, "Why do you quarrel with me? Why do you put the LORD to a test?"
The test the Israelites put God to at Massah in the desert was not an extravagant one. They weren't looking for anything fancy or flashy, they were looking for water.
Asking God for water is what His people are supposed to do.
But the difference between, "You love us, give us water," and, "If You love us, give us water," is the difference between a prayer and a test, between a relationship of faith and a relationship of contractual obligations.