1)
How did David know this?
1.
'Rashi', Radak: He saw that other kings send gifts to him. Rashi (Shmuel II, 5:12) ? and that all his deeds succeed.
2.
Vilna Gaon: He saw that Tzur, which is [from] Edom, is submissive to him.
3.
Malbim: He saw that all of Yisrael, from Shichor Egypt until l'Vo Chamas, gathered based on his command. Also, Melech Tzur sent to him.


