Usually, it's because they have something the other person wants, like if Iraq has oil and the US wants it, and Iraq wants guns and the US has that, then the two countries could form an alliance based off of trade, and the alliance could only prosper if one side has what the other side wants. Also, if a side needed help with a war, they could ask countries for help, and usually they have to give something in return, like if Guyana needed help with fighting with Kirghizistan, and they reached out to the US, the US could help them, but after the war, Guyana had to provide the US with titanium (These are examples, not actual things.). Hope this helps!
Islam came to the Southeast Asia, first by the way of Muslim traders along the main trade-route between Asia and the Far East,<u> then was further spread by Sufi orders and finally consolidated by the expansion of the territories of converted rulers and their communities.</u>
<u />
<u />
<u />
hope this helps !
source: wiki