As said, chalk and cheese. Switzerland has nothing to lose, no instability to worry about, etc, etc. It was able to secure trade deals with the EU without joining- but again, this was a the cost of
- free movement of people from EU
- large fees paid to the EU without any say
- same rules and regs re safety, products, etc
On a much smaller scale, Switzerland is made up of 3 very distinct cultural groups, with different languages, different origins, different history - and very different attitudes. Romandie, the French part is much more pro Europe than the German part- the German part is the majority- so in a direct democracy, always wins! Basel generally votes with the French speakers, and Zurich often too. The rest is by a huge majority still very rural and not very open to the outside world.
As said, totally different situation- no risks for them as is the case for the UK. But do remember that Switzerland has a higher % of immigrants than the UK- and cannot stop free movement within EU. It is also a favourite place for asylum seekers from all over the world.