We all know that playstore doesn't have root then how can the apk install automatically and it even uninstalls are possible is that 'cause of google play services? If not then please mention how else. I've heard that playstore directly downloads apk to /data and deletes after installation. Where exactly does it store the apks?
Play store is almost always installed as a system app, and thus has access to the permission
android.permission.INSTALL_PACKAGES - the introduction specifically states "not for use by third-party applications". Therefore it's capable of accessing Package Manager (
If you attempt to access
pm in an app without root, you will be greeted with the message "Neither user xxxx nor current process has android.permission.INSTALL_PACKAGES".