The way this particular app works is as a "thin client"
The software running on your local device is just a relay. It accepts your inputs and sends them to a remote server.
The game running "inside" the app is actually running on that server. It accepts the relayed input and uses it to update the game state, and streams the resulting rendered video to your device for display.
This is similar to how the old game streaming service OnLive worked, a model which is now most famously used by Google Stadia.
With this model the game can run on hardware vastly more powerful than the device the player is holding, but at the cost of lots of bandwidth to transmit the rendered view, and latency from the back-and-forth communication (and compression/decompression) involved.
As for how to implement your own steaming platform in this vein, my advice would be: do not do this.
Doing this well, managing the sheer bandwidth demands and optimizing latency, takes an immense investment in engineering and infrastructure — a Google-scale project. If you have to ask how to do it on StackExchange, then it is very likely you do not have the resources to pull it off successfully.
A better bet may be to evaluate existing, battle-tested streaming platforms, to see if any of them would meet your needs, then release your game on that platform. Let the experts in streaming handle that part, so you can focus on your game.