In the EU Referendum 37.5 % of the electorate voted to leave, 34.7 % of the electorate voted to remain and 27.8 % didn't vote. If a threshold had been set in the Act that enabled the referendum to take place, such as the "at least 40 % of total electorate must vote in favour" that was set in the Scotland Act 1978, then the leave vote would have failed. If a lower threshold had been set then it would still have passed.
The concept is that if the people want to change from a status-quo that has been established by duly elected democratic governments they must show that a significant section of the population want the change, not just a simple majority of those that vote. Obviously people will disagree whether such thresholds should be used or, if used, what they should be but countries that are more knowledgeable about referenda do tend to use them. The details of how they are used vary from country to country. Denmark, for example, uses exactly the rule used in the Scotland Act 1978 for any constitutional changes. It can also use referenda to vote against bills, which don't alter the constitution, that have gained parliamentary approval but in that case it has a threshold of 30 % of the electorate. Switzerland doesn't use a percentage threshold but requires a double majority, i.e. a majority of total voters and a majority of Cantons.
PS I am not trying to argue whether such a threshold should or should not have been included in the EU Referendum Act but it is clear that a lot more thought was needed than was given.