Short answer, both.
Long answer:
Autocorrect uses (used to?) data from other users to "improve" autocorrect. I can't recall the specific name of that feature. Also, it learns from your way of spelling out words, so a dictionary reset might become necessary over time.
Also, the autocorrect system will adjust based on which keyboards, and regional dialects, are enabled on your device.
For instance, in my case, I have Canadian English and Canadian French languages enabled, so autocorrect will correct for both languages, mixing them together.
It will allow the use of "colour", "realize", "curb", and give a mistake for "color", "realise", "kerb". It will also recognize our regional words, like "tuque" (knitted winter hat), "runners" (running shoes), "loonie" ($1 coin) and "toonie" ($2 coin).
However, it will also mix up languages with those you have configured from time to time, in my case something correcting English to irrelevant French word.
Finally, they may have improved autocorrect in iOS 17. I am yet to see significant improvements in that regard.
About ducking time.
www.imore.com