Can someone install a keylogger on a non-Jailbroken iPhone?

Solution 1:

Yes, but only with the Apple ID & password.

This makes it really a parental tool on a child's account rather than a general threat to regular users.

There's a list here of some of the better-known loggers, but most are jailbreak only, the others need AppleID details.
https://janetcpatterson.medium.com/top-10-best-keyloggers-for-ios-771d85b2d330