Ok but the main question I have is, is it possible that my phone was hacked and someone has my passwords
The reason I'm asking is because I read about all the fake apps in the play store the hackers use to Steele people's personal data
As Mr Spock might say, "insufficient data".
The simplest explanation for what you describe is that you have downloaded and installed an app which has the capability of installing other apps. That might be the only thing it can do, in which case your phone has not been hacked, you've just installed and enabled something unwanted. But it's hard to ever say definitively that someone hasn't been hacked, because a
smart hacker who was after your credentials would not then advertise their presence by installing games - if they are any good you might not know at all. If you are worried about hacking the most likely route is via your Google account, so I would review which devices have connected to it and see whether there is any unexpected activity there. But I think hacking is not the most likely explanation here. However, if you have suffered unauthorised app installs we cannot know what those apps might contain, so while it's possible that this is just an unethical way of promoting some (probably ad-filled) games we can't say for sure.
We don't know what is behind these app installs, though logically it has to be an app that has permission to install other apps. If you scan for apps with that permission (many security apps can do this) that can narrow down the list of candidates. If you are running a modern version of Android you should have to grant the app that permission (which would narrow it further - look in Settings > Apps > Advanced > Special App Access or something similar), while on older versions once you enable installation from "unknown sources" any app with that permission could use it. If you are using APKPure you will have to have enabled at least one app to do this in order to be able to install apps downloaded from them.
If you want my guess as to where you might start looking, look at your web browser. You said you found a web shortcut to this app on your desktop after looking at it in the browser, so if the browser is capable of placing shortcuts on your desktop (and many are) the most obvious explanation is that some ad script on the site told the browser to do this. If you have granted the browser "special access" to install unknown apps then the same procedure could in principle be used to install apps: this is why I think it's an appalling piece of design that any browser should be allowed to even have the permission to request app installation, and why I would never grant this to one of my browsers. But it's something that I suspect some people do out of a misplaced sense of "convenience": it saves you having to download an apk and then use something else to install it (yay, save a couple of clicks by granting the power to install malware to the app most likely to be targetted by a malware installer, really smart!).
However, the thing that doesn't fit is that the suspect apps are being reinstalled after a factory reset. A reset should rescind any special access, or on an older Android versions clear the setting to allow installation from unknown sources. Of course if you reinstall other apps after the reset, or if you have a backup of settings which gets reinstalled, that would be different. I'd check whether the permission to install from unknown sources has been granted to anything, and if it has make sure you don't just restore a problem after a reset.