Warning: skip this if you don't like long posts
It is elusive because it didn't happen with a clean break. And it's the result of a number of changes happening on a number of different aspects of the language, somewhat independently and not all exactly at the same time, over 100 to 150 years. At the turn of the 20th century, the tonal system in classical music basically collapsed and new languages were invented and developed in response, sometimes in opposition, to tonality, all within a period of maybe 30 years or so. It is tempting, and often the way we are taught, to see every major change in music history through the lenses of reaction and great revolutionary innovation, but in reality, that collapse of the tonal language in classical music is pretty unique. Most other changes in music history happened slower and much more organically, so the borders can be extremely blurry. In the baroque period, the tonal system didn't suddenly replace the modal system, it coalesced/emerged out of it. So it's not so much that people "preferred" something or "changed their mind" in a revolutionary way. It's an evolution that took place over several generations, and some of it was the result of innovations and additions to the modal language that initially reinforced it rather than moved away from it. It's a transition that also happened while many other aspects of the musical language and aesthetic did not change (hence why its all still considered part of the baroque era, and not split into two). For example, Schütz and Bach still have more in common overall than Bach and Berlioz, even though Schütz wrote modal music and Bach and Berlioz tonal music. That all makes it really hard to establish when exactly tonality starts and what if anything itinially distinguishes it from modality.
Ultimately, I think many scholars agree that one of the key elements that led to the development of tonality was basso continuo. As time went by, some set ways of realising certain bassline movements became more and more standardised (no matter the mode), making the lines between modes more and more blurry. By the time you get to the "rule of the octave" in the very early 18th century, you pretty much don't have distinct modes anymore (yet tonality had also not yet fully cristalized into the harmonic language shared by the classical and romantic composers either). Another element without which tonality would not have been possible was the gradual shift away from meantone tuning in favour of temperaments that sacrifice pure harmonies to allow more transpositions. Initially, that's not necessarily a bad thing for modality as it allows modes to be transposed to more different positions. But it also accelerated the modes losing their distinct identities because one was no longer forced to "stay in the mode" by the mere availability or unavailability of certain notes.
Somewhat of a tangent: one of the clearest examples in modern musical theory/history that, to me, shows we overall don't have a full understanding of the question, at least in mainstream music pedagogy, is that the tonal minor mode is still usually defined as the Aeolian mode. In reality, it is an amalgam of several of the modes as they gradually lost their distinctive individual traits, but I would argue it predominantly corresponds not to the former Aeolian mode, but to Dorian. Dorian was the most commonly-used of all modes, and unlike the other "minor" modes, it already contained in itself many of the characteristics of the tonal minor mode, and, notably, has all of the notes of the tonal minor. The raised 7th degree is simply the result of creating cadences, and happens in every mode except Phrygian. Dorian naturally has the high 6th degree, but the lowered 6th degree is extremely common, as a result of the "fa super la" rule of solmisation whereby one only going out of the hexachord by one note above "la" should always go only a semitone higher, even if the next note should be a whole tone higher and that therefore requires adding an accidental flat. Because it happens that the 5th degree in the Dorian mode can more often than not be solmised as "la", the 6th degree very often ends up being flattened, and the Dorian mode effectively contains both versions of the sixth degree on a more or less equal footing, just like the tonal minor. In Renaissance and early Baroque music, Aeolian has the low 6th degree naturally, but the raised 6th degree only ever happens melodically at cadential ornaments. Most treatments of the 6th degree in the tonal language make perfect sense in Dorian but make no sense in Aeolian. No coincidence either than many high baroque and even early classical works in minor use the key signature for Dorian (G minor with 1 flat, D minor with no alterations, etc.)