It has nothing to do with third party app stores.
Someone made an app that was genuinely very good. Then a company wanted to buy the app. The developer sold the app. The company loaded it with whatever spyware they wanted and pushed it in an update.
Now the app is garbage. Sadly it happens all the time. It happened to me right after I bought a year subscription to private internet access.
But to be clear this can happen on any platform or App Store official or not.
Sorry, I was not very clear. I was speaking generally about how this process works to demonstrate that it has nothing to do with app stores.