Switzerland has manged its relationship with the EU (and its predecessors) via a series of individual treaties covering separate topics such as trade, transport and so on. Switzerland has had to steadily relinquish a lot of its sovereign rights (such as border control – the subject of this question) as part of these treaties. This seemed to work OK until about ten years ago when the EU began to pressurise Switzerland to enter into an all-encompassing agreement which comes very close to “associate” membership of the EU and provides the EU with far more say over Switzerland’s affairs.
To a great extent Switzerland is largely in the same position as the UK was over Brexit. In order to maintain its unfettered trading ties with the EU and for its citizens to have the right to live and work in the EU, it will have to continue to relinquish its sovereignty. This referendum will probably decide what way its people want to go. The matter of free movement has already been aired. In 2014 the Swiss (who hold, on average, four referendums each year) voted for quotas to limit EU immigration into the country. As with Brexit, the stakes are high – a vote to end free movement will probably see an end to the country’s current trading arrangements with the EU and a far more restricted arrangement take its place.