DNA locks, actually. When a poké ball activates on a pokémon for the first time, it scans its capture in order to take careful notes about what it’s containing. This—combined with a pokémon’s decision to either stay or break free, of course—is why there’s a window of time between the ball drawing in a pokémon and the capture being confirmed, wherein the ball could, well, break. It’s simply taking the time to scan and record the genetic code of the pokémon it’s meant to contain.
This all is relevant because even if you have two members of the same species, there are subtle differences in the genetic code of one individual compared to the next. After all, you might not be like any other human in the world, and so, too, each pokémon is different and individual from the rest of its species.
Vespiquen is an interesting case because it forms a symbiotic relationship with another living being. (Actually, slowbro/king and mantine are very similar in nature—it’s just that they share existences with other pokémon, rather than animals.) In her case, though, the point still stands. It’s just that the poké ball scans and records all beings drawn in, rather than just one.
Of course, it gets a little more complicated with evolution, particularly ones that involve multiple members of the same species to achieve (magneton and metang, for a couple of examples). In these cases, though, so long as a considerable amount of the subject’s DNA is present and so long as the subject’s species matches the pokédex database in terms of pokémon that incorporate others into their evolutions, the poké ball will still recognize the pokémon it belongs to. It would then modify its internal code in order to adjust.
Truth be told, modern poké balls seem like they’re simple devices, but they’re actually highly complex and fascinating machines. Of course, I also say that this is all true for modern poké balls. Antique poké balls, particularly of the apricorn variety, are a bit more mysterious, and the art of creating them is a carefully guarded secret.
