When defeated in a Pokémon battle, a Pokémon flagged as having a chance to join the player’s party on defeat rolls to see if it requests to join the player’s party. By default, the chance is 100%, so it’s guaranteed, but that can be changed in the config. The player is then presented with a screen to confirm whether or not they would like to have the Pokémon join their team. If the player selects Proceed, the Pokémon will join their party, or be sent to their PC. If the player selects Cancel, the Pokémon will run away into the wild.
As a player, if you do not want to see the confirmation screen, and just want to have the Pokémon immediately join your team, change the alwaysAcceptJoin in your client-side config to true and reload your config.