The star and crescent is not an Islamic symbol in origin, in scripture, or in law. There is no verse of the Quran and no hadith that assigns any emblem to the religion, and the visual culture of early Islam is calligraphic rather than emblematic: the shahada, the name of God, and geometric ornament do the work that a badge does elsewhere.
The transition is Ottoman and it is late. Ottoman state use of the star and crescent begins in the reign of Mustafa III, in the third quarter of the eighteenth century, becomes established under Abdul Hamid I, and is formalised by the Ottoman flag law of 1844, which fixed the red field with white crescent and star. Before that the Ottomans had used a variety of devices, including multiple crescents and the sword of Ali.
Because the Ottoman Empire was for centuries the most visible Islamic polity to European eyes, its state emblem was read abroad as the emblem of the religion, and that reading hardened during the nineteenth century. When the empire's relief service needed a counterpart to the Red Cross it used the crescent, which further fixed the equation. The successor states of the empire, and later a number of unrelated Muslim-majority countries, adopted crescents on their flags on the same understanding.
The objection from within is straightforward and is worth stating. A number of Muslim scholars reject the crescent as a symbol of Islam precisely because it has no scriptural basis and because it originates in the astral religion the faith displaced. That position is a minority one in practice but it is not a fringe argument, and it explains why the symbol is absent from Saudi and several other flags.