That's based on including old polls. An average depends upon how you draw up the average.
Looking at the final polls for each pollster the Remain lead was as follows:
Populus Online Remain +10
Comres Phone Remain +8
ORB Phone Remain +8
BMG Phone Remain +7.6
Ipsos MORI Phone Remain +4
YouGov Online Remain +2
Survation Phone Remain +1
Opinium Online Leave (-1.3)
TNS Online Leave (-2.4)
There was a heavy swing towards Remain in the final days, which was what common experience had expected a swing to the status quo. The pollsters mucked that up.
Two possible explanations are that either the postal ballots before a late swing were missed by the pollsters (I doubt that) or that there were Shy Leavers quite possible caused by heavy slandering of Leavers as racists especially following the murder of Jo Cox. Given that the biggest errors (excluding Populus) were with the Phone Pollsters that's quite plausible.

