The following is a real-world example - I'm not an iOS developer, so I am trying to understand how this can be possible:
Create a new, test Google account and when done, create a test Apple ID.
Set up an iOS device, and at the stage where you are asked to enter the details to log into an Apple ID, choose to skip this for now.
When taken to Springboard, launch the App Store, and search for "Assistant". Tap the "Get" button, at which time you will be asked to log into the iTunes Store. Do this by entering the details for the just-created Apple ID, at which point the app will begin to download. Note that we have in no way logged into iCloud, and that we have just logged into the iTunes store for the purpose of downloading the app.
When the app has finished downloading, launch it and when asked to sign in, enter the details for the new Google account (created in step 1). You should now be signed into the Assistant app.
Go back to the Home screen, and remove the Assistant app; confirm when prompted so that it will be removed from the device.
Now, go back to the App Store, and search for "Gmail". Choose to download this - you shouldn't be prompted to log into an Apple ID, because iOS has saved the details when Assistant was downloaded.
Launch the app, and tap the "Sign In" button. Notice that the previously-entered Google account is listed - this will match the one used to sign into Assistant. Tapping on this account will allow you to access Gmail with those details, without being prompted to enter a password of any kind whatsoever.
For me, the most interesting aspect of this is that even after the Assistant app is removed, the details for the Google account entered into the app before being uninstalled are still remembered. I haven't been able to figure out how this is done; it can't be iCloud (because it wasn't enabled at the time of the initial installation of Assistant). Does anybody know how it's possible that even after an app is uninstalled, another app is able to read data previously written to memory by a separate app?