Insert a disassembled padlock (without the ear of the lock) thru the bottle neck, and reassemble it inside the bottle. Then, carefully hook the ear into the cork, and insert it into the bottle, then carefully attach the ear into one of the holes of the padlock.
Then fully insert the cork, and then use some shaking of the bottle to click the padlock into a locked position.
Or they just used magic.