Just quick read it says Arab traders in the 13th century. But how did it actually get to the point where the large majority all accepted a brand new idea? I can’t imagine trying to sell a religion so 80+% of the population ends up accepting it to be an easy task
There's always more that can be said, but you might enjoy starting with this older answer from a now sadly deleted user. How did Indonesia and Malaysia become majority-Muslim when they were once dominated by Hindu and Buddhist kingdoms?