If a referendum were held -- and it would happen only if there were substantial and sustained agitation by the population for one -- and if the voters chose to abolish the monarchy, what, exactly, do you think the royals could do about it? They don't command any armies. The Navy may be called "Royal," but that's merely tradition. The Queen can't raise her hand and decree that her troops march on Parliament or anywhere else. It wouldn't happen if she tried.
No, the royals would go, though not without a lot of complex negotiations over the Crown Estate and the Duchies of Lancaster and Cornwall. They'd end up walking away with plenty of wealth, and the UK would be left to get on with looking like a substantially less interesting country that had just lost one of the most significant pillars of its history and national identity. It would also lose all of the revenue that the monarchy is worth to the country, and I am not referring merely to income from tourism.
But it won't happen, not because the royals won't permit it (they have no power to do that), but because the British population is NOT agitating for a referendum and abolition. Perhaps they will do so at some point in the future, but it's not happening now.