It happened because it was voted for and the elite wanted it.
Several counterfactuals are plausible: either the elite only allowed the vote because they knew how it would go, or they would've brexited even if remain won, or they don't care either way. What is not possible is that the elites wanted to remain but were forced to leave by the vote, because in that case they simply wouldn't have left.