Usually these games are built on top of a map service such as OpenStreetMaps (which is used by Pokémon GO) or Google Maps (used by Jurassic World: Alive). For more information regarding how the games utilise the map services, please see the following study:
Baer, M., Tregel, T., Laato, S., & Söbke, H. (2022). Virtually (re) constructed reality: the representation of physical space in commercial location-based games. In Proceedings of the 25th International Academic Mindtrek Conference (pp. 9-22).
For generating PokéStops and Gyms, Niantic utilized crowdsourcing. More specifically, a form of close-range sensing where players submitted (and later peer-reviewed) points of interest. For more information regarding this process, please refer to the this study:
Laato, S., Hyrynsalmi, S. M., & Paloheimo, M. (2019). Online multiplayer games for crowdsourcing the development of digital assets: The case of ingress. In Software Business: 10th International Conference, ICSOB 2019, Jyväskylä, Finland, November 18–20, 2019, Proceedings 10 (pp. 387-401). Springer International Publishing.
Finally, it is not entirely clear how Niantic determines the Pokémon spawn locations. However, most likely this is a combination of player activity in certain areas, and spawning Pokémon to certain geotags in OpenStreetMap (such as trails), and similarly not spawning Pokémon in other areas (e.g. highways), and spawning Pokémon to the proximity of PokéStops and Gyms.
As globally available live-service location-based games, games such as Pokémon GO and Jurassic World: Alive have heavily automated all these processes.