Yes they do. If you choose to keep a Pokemon you caught, you take that one and the others simply go away with the Pokeballs you caught in. Choose wisely: I recommend you take the legendary. If you have already caught it in a previous trip, take one that isn't in your Pokedex.
Hope I helped!