Well, acetates get pressed and either walk out the door in the possession of either the artist, someone working at the studio or someone from the record company. The latter two, more often than the former I'll bet, get sold or given away and eventually find their way onto the collectors' market.
Demos get recorded from masters in the studio, for any number of reasons, legitimate or otherwise. Legitimate reasons include the artist wanting to take a work-in-progress home, a record company wanting to hear what the artist is working on, or just to test different mixes and edits. More nefarious ways include people simply digging this stuff up in the vaults and copying it, then taking it home and selling it to pay off gambling debts or whatever.
Copies get made for things like fan club conventions and those tapes have to go somewhere eventually. It's not like the vaults at studios have armed guards and retinal scan technology to limit access. If you work there, you can get in. I'm sure for a long time Queen Productions was not in the habit of taking extraordinary measures to keep these things under wraps. Until the internet boomed in the mid-'90s, these demos were only passing through a limited market of collectors.
Believe me, Queen are not the only band who have this kind of fanatical devotion to the almighty "unreleased"! Pick any decent artist or band at random and I'm sure you'll find devotees somewhere comparing notes on unreleased demos and the history of specific tracks. Off the top of my head I can tell you it occurs with great vigor around Mike Oldfield, Nick Cave And the Bad Seeds, David Bowie and the Small Faces, just name a few (and to give you a cross-section of genres and listeners).