The game uses a random encounter system. This means that Pokémon will appear on the screen at random intervals, regardless of your actions. There is no way to avoid or predict these encounters.
While it might seem like you are sneaking up on Pokémon when they suddenly appear, you are simply encountering them through the game's random encounter mechanic.
If you're interested in strategies for encountering specific Pokémon, you can try using Repels, which prevent wild Pokémon from appearing for a short time, or exploring specific areas that are known to have high encounter rates for certain Pokémon.