The basic story
In Latin and Latinate words spelled with ⟨ti⟩ plus a vowel letter, the letter ⟨t⟩ had acquired the sound [ts] before these words had entered English. The affricate [ts], which is still found in present-day Italian, was simplified in French and in English to the simple fricative [s]. (The timeline of this simplification is not too relevant, so I'll frequently refer in this post to [(t)s] meaning simply "[ts] or [s]"). That resulting [s] is the input to the English palatalization rule, which then produced [ʃ] from [si~sj].
How ⟨t⟩ came to be pronounced [ts] here
The pronunciation of Latin ⟨ti⟩ with [ts] originated from what was probably a natural sound change in Latin. I wrote a little about it on the Latin Stack Exchange.
A minor note about syllabification. Some sources say that the sound change would have taken place at a time when the letter ⟨i⟩ corresponded to a non-syllabic glide [j]: that is, the change was [tj] > [tsj]. However, even if the [ts] pronunciation originated from a sound change applying to [t] before [j], eventually [(t)s] came to be a conventionalized pronunciation of the letter ⟨t⟩ in the graphical context ⟨ti⟩ + vowel letter that could be used regardless of whether the i was pronounced as [j] or [i]. For example, the pronunciation [(t)si] can be found even in stressed syllables, where [(t)sj] is not a possible alternative pronunciation.
So by the time that we're concerned with, the pronunciation of Latin ⟨ti⟩ words with [(t)si] was a feature of the educated pronunciation of Latin and learned words taken from Latin, not a feature of the pronunciation of words that developed through regular sound changes. (In French words that developed through regular sound changes, Latin ⟨ti⟩ plus a vowel went instead to ⟨s⟩ (with no following ⟨i⟩), pronounced as a voiced fricative [z] between vowels, as in raison, saison from rationem, sationem, and as [s] after an ⟨n⟩, as in chanson from cantionem.)
A note about spelling. It turns out that Latin ⟨ci⟩ between vowels had also come to be pronounced as [(t)si] in the educated pronunciation used by French speakers for Latin and Latinate words. So words that had in Latin been spelled with ⟨ti⟩ were frequently spelled with ⟨ci⟩ or equivalently, ⟨cy⟩ (the letters ⟨i⟩ and ⟨y⟩ were used interchangeably in many contexts).
⟨sti⟩ is an exception to the assibilated pronunciation of Latin ⟨ti⟩
When ⟨ti⟩ occurred after [s] in Latinate words, it was not pronounced with [(t)s]. In French of past and present, question simply has [t]. So words like question entered English with [t], which was then palatalized to [tʃ].