Ok, so the screenshots were very helpful! Thanks for posting those.
The "Message Hands", "Classic Mac", "Messages Smileys", "Messages Hearts", are all Apple created apps that are specifically designed for your iMessage app on your iPhone & Mac. Those would have had to be installed on your devices by a person. They do not automatically install by themselves.
Can you clarify what you mean by iCloud? I ask this because its doesn't make sense for any App, from the App Store to install itself into iCloud. See below for details
The app that appeared on iCloud is called WebSite Scanner and it’s a white icon in the App Store. When it appeared suddenly I checked the AppStore to see if I had downloaded it but the icon showed that it was never originally downloaded yet from the AppStore so I just deleted the appearing app in iCloud. This was in iOS while checking iCloud.
"I've never performed a Factory Reset on my Mac yet. but I did on my phone a few months ago and restored it from iCloud backups."
^^^^^^^^ - Do a Factory Reset again, but set your phone up as a new phone and DO NOT RESTORE iCloud. that way nothing will be installed on your phone. You can still sign into your account, but don't restore from any backups.
If possible, try and delete the iCloud backups. This article should help - https://www.imore.com/how-delete-old-icloud-backups
Let me know how its goes. :)