I think that the Brexit vote landed at a time when there was increasing general alienation within society, a general feeling of growing wealth inequality, of social injustice etc. We saw it with Trump's election, we saw it with Brexit. We'll probably see it with a reform majority in the UK parliament next election too.
There are global trends that the PM of the UK cannot change, but we live in a world of instant gratification so if the current PM can't make things change literally overnight, people are angry and annoyed.
Go read the comments section on any UK newspaper (left or right, tabloid or broadsheet) and the comments are really eye-opening (recommend doing this to at least get a flawed and partial cross section of what the vibe is). People are quick to anger and quick to point fingers. Might explain why we've had so many PMs these past few years.