By the time Israel reached the plains of Moab, they had already defeated several kings on their way toward the Promised Land. That made Balak, the king of Moab, nervous. Instead of trying to fight Israel himself, Balak sent messengers to a man named Balaam and asked him to come to Moab and curse the Israelites.
Balaam was a seer, someone believed to receive messages or insight from the divine. Balak told him, “For I know that he whom you bless is blessed, and he whom you curse is cursed.” The messengers arrived carrying payment for divination and stayed with Balaam while he waited to hear what God would tell him.

God came to Balaam and asked, “Who are these men with you?”
God obviously knew who the men were. He also knew why they were there. As with so many of the questions God asks in Scripture, He wasn’t looking for information. He was making Balaam identify exactly what was sitting in his house and what they wanted from him.
Balaam told God that Balak had sent them because a people had come out of Egypt and covered the land. Balak wanted Balaam to curse them so he could fight them and drive them away.
God’s answer left very little room for confusion. “Do not go with them; you shall not curse the people, for they are blessed.”
Balaam sent the men home, but Balak wasn’t finished. He sent another group of officials, this time more numerous and more distinguished, and promised Balaam great honor if he would come. Balaam said that even if Balak gave him a house full of silver and gold, he couldn’t do anything contrary to God’s command. Yet he invited the men to stay overnight while he asked God again what He wanted him to do.
God eventually allowed Balaam to go, but only on the condition that he say what God told him to say. Balaam went, God’s anger was kindled as he traveled, and before long we get to the famous part involving a donkey who could see the Angel of the LORD when Balaam couldn’t. If you want the rest of that weird little detour, see Balaam Wuz Here for a three-minute video about proof of Balaam’s existence.
The donkey tends to steal the show, because talking donkeys will do that (Numbers 22:22–35), but God’s first question came before any of it.
“Who are these men with you?”
Balaam knew who they were. God knew who they were. More importantly, Balaam knew what God had already said about the people Balak wanted him to curse.
They were blessed.
God has more questions. See Let Me Ask You Something: When God Asks a Direct Question.