Not true, you get the open source code and you compile it yourself then compare the checksum of what you compiled with app installer. If they match that means they didn't add extra code besides whats in the open source.
While the other responses so far have good info, none has offered a useful answer. Yes, apple collects data, but thankfully don’t sell it to the world. Buying a new phone isn’t a trivial expense so some of us are stuck for a bit. As a fellow IOS user (for now), I too would like to hear some more options.
The best I’ve found so far is Typewise. They claim to be private and secure but it’s closed source so so knows. Apple gets to review their code when submitting to the app store which says that Typewise collects some data but none of it is linked to the user. It’s freemium. Unfortunately, I don’t like their keyboard. Swipe typing is my personal requirement🙂
Apple have their own eco system that are fully closed source. If you want to install apps from another place than from AppStore and if you don't live in EU, good luck.
If you want privacy, choose a custom ROM of Android that respects your privacy (like GrapheneOS) or (better yet) choose Linux. But to be honest, Android from Google (no custom ROM) do have better privacy options compared to iOS, mainly thanks to being able to installing and using apps with no Google account whatsoever.
As the person criticizing the top level comments, I just want to say thanks. This is a straight answer and an option that I wasn’t aware of. Looking into it!
Apple gets your voice recordings which for various privacy laws they can’t resell. “Yay wiretap laws from the 50s”
As for typing, a quick search, apple support claims that the keyboard cache is only used for autocorrect purposes. How often you use a word and how you like to spell it.
Having it function as a keylogger would give them a headache, from data use, battery life, hackers exploiting it, etc.
And of course the warnings seem targeted at third party keyboards who can add on extra feature beyond IOS barebones.