The dots that separate ba from ta, tha, nun and ya are called i'jam, and they were not part of the script when Arabic first began to be written. The Nabataean cursive from which Arabic descends offered fewer distinct shapes than Arabic had consonants, and early Arabic writing simply left the ambiguity in place, relying on a reader who already knew the language and often already knew the text. Someone who had a passage by heart did not need the script to tell one letter from another.
Dots appear in Arabic documents from the first century of Islam, and their extension to copies of the Quran was resisted before it was accepted. The tradition assigns the systematic pointing of the Quranic text to administrators and grammarians of Basra and Kufa under the Umayyads, and assigns the separate system of vowel marks to the same milieu, though who did what is reported differently by different sources and the details are not settled. The sequence itself is not in doubt: consonantal skeleton first, consonantal pointing second, vowel marking third.
The two systems remain visually distinct. The i'jam dots are written in the same ink and the same weight as the letters and belong to the spelling, so a word written without them is misspelled. The vowel marks, tashkil, are small strokes and circles above and below the line, frequently written in a second colour in early manuscripts, and they are optional in ordinary modern printing. A newspaper prints the dots and omits the vowels. A Quran prints both, because the exactness of the recitation the marks were devised to protect depends on them.