How to prevent that from happening? For example, I definitely do not believe that this surge of reputation actually happened: https://academia.stackexchange.com/users/6393/espanta?tab=reputation
There is a series of scripts which Stack Exchange runs to try to find suspicious voting patterns. If they are in fact the same user, then this will be detected over time. For now, though, I would suspect that the two users at least definitely know each other, although from what I can tell this doesn't appear to be a sockpuppet situation.