In the 1800s, scholars who knew a lot of languages (including, often, several modern and ancient European languages, and increasingly also Sanskrit) started to notice some amazing patterns about similarities in words among all of these languages, including languages from very far apart and that had no visible connection at all from the point of view of their present-day speakers.

As these patterns were explored, they were found to be even more systematic and pervasive than they had appeared. In some cases, one sound would systematically change into another sound from language A to language B.

https://en.wikipedia.org/wiki/Grimm%27s_law

These patterns helped reveal historical connections between most languages of Europe, Central Asia, and South Asia, showing that those languages had descended from the same ancient sources. (Note that this isn't true of 100% of languages in this region -- there are other unrelated families that turned up -- but it's true of a significant majority.)

https://en.wikipedia.org/wiki/Indo-European_languages

The languages that turned out to be related this way included the Germanic family (like German, English, Dutch, and the Scandinavian languages), the Romance family (like French, Spanish, Portuguese, Romanian, and Catalan), the Celtic family (like Irish and Welsh), the Slavic family (like Russian, Bulgarian, and Ukrainian), and also Farsi and all the Central Asian languages related to it, and Hindi/Urdu and all the South Asian languages related to it. Oh, and Greek.

If I tried to list all the languages and language families that were linked up to this family tree, we would probably be here all day, because they go on and on. Just under half the people in the whole world have one or another of them as a native language today!

These languages changed quickly enough in history that most people no longer noticed, or remembered, that most of them were related to one another, yet slowly enough that it's been feasible to deduce an enormous amount of information about the history of particular languages and particular words, once many of the rules and patterns had been identified.

A Grimm's Law example is that the h sound in Germanic languages usually corresponds to the k sound in Romance languages (note that this can be stated much more technically and accurately). So, it turns out that "hundred" and "cent"/"cento"/"centum" actually share the same origin. And "heart" and "cœur"/"corazón"/"καρδία" (origin of "cardiac") (also "cordial"; the root in Latin sounds like "cord-"). And "who" and "que"/"quoi"/"qui" (and similarly for other wh- questions in English and qu- questions in Romance, which were originally hw- sounds in English and kw- sounds in Latin).

Some other examples are t to d ("ten" and "decem"/"diez"/"dez", plus some of the examples above that have a t in English), and f to p ("foot" and the Latin and Greek words from which we get "pedestrian" and "podiatrist", and Romance "pied"/"pie"/"pé"; and don't forget about "father" and "padre"/"pater"/...).

Those are just a couple of the phenomena that people noticed in the 1800s; while the exact development of these patterns gets much more complicated, they've proven to work over and over and over, for hundreds of languages and hundreds of thousands of words!

(... Also, the Grimm from Grimm's Law is one of the Brothers Grimm, from Grimm's Fairytales!)