How did David know this?
Rashi: He saw that all his deeds succeed, and other kings send gifts to him.