The Lord gave Solomon wisdom - It seems to be implied that Solomon’s divine gift of wisdom enabled him to make such favorable arrangements with Hiram.
Related Commentaries of 1 Kings 5:12
1 Kings 5:12
12 And the LORD gave Solomon wisdom, as he promised him: and there was peace between Hiram and Solomon; and they two made a league together.