Basically, two arms extend from the roof and latch into the sunroof at the back. They are secure, if it's cracked open you can't raise it beyond the couple of inches as the arms hold it in place. To free the sunroof to take it out completely, you have to retract these arms; this can't be done on the move, or without the key, as the ignition has to be turned to "accessory", or position 1. At this point the roof will raise all the way to vertical, but is still held secure by the two clips at the front.
I'm guessing you're wondering how it's got lost? If the arms are broken (the sacrificial cogs stripped), or the microswitch at the front (above the mirror) that recognises you've put the roof back in has failed, then it's possible the roof is sitting in it's hole normally, but if you pushed it up it would open. They lift on the motorway, quite un-nerving when it pops up an inch or two at speed, but it's still secured at the front, and wind will always push it back down. I can see how, if the roof wasn't held by the two arms and you drove it backwards very fast (i.e. on a truck) it could fly off, but it would have broken the front clips and there would be damage visible I'd guess?