>>34437079It's based on something called a personality value - a hidden variable all Pokémon have. All it does is determine various aspects of the Pokémon such as gender and nature when you first encounter it, and can't be influenced by you in any way. For all intents and purposes, which of the two Wurmple evolves into is random, but predetermined for each individual Wurmple.