They’re actually different parts of speech, practically different words, that are spelled the same. Most of the time, unless you’re specifically enunciating, they’re not even said the same! The first one is often weak, and said more like “thet” or “thit”, whereas the second one is always said “that”.
Like in “he said that that window…”, the second one could be replaced with “this window” or “the blue window”, but the first one is a grammatical structure and can’t be replaced with “this”. And again, if you listen to a native English speaker (at least with most accents) speaking at speed they’ll say the grammatical one “thit” (or something like it), and if you were to say “that window is blue” with the same pronunciation of “that” as you do for the other “that”, it would sound wrong. Because your brain knows they’re not interchangeable words.
They’re actually different parts of speech, practically different words, that are spelled the same. Most of the time, unless you’re specifically enunciating, they’re not even said the same! The first one is often weak, and said more like “thet” or “thit”, whereas the second one is always said “that”.
Like in “he said that that window…”, the second one could be replaced with “this window” or “the blue window”, but the first one is a grammatical structure and can’t be replaced with “this”. And again, if you listen to a native English speaker (at least with most accents) speaking at speed they’ll say the grammatical one “thit” (or something like it), and if you were to say “that window is blue” with the same pronunciation of “that” as you do for the other “that”, it would sound wrong. Because your brain knows they’re not interchangeable words.
Or at least you’ll sounds Kiwi 😉