Here are 3 of most common queen cages, JB BZ plastic cages, the Three Hole wooden cages and the California Mini cages (my favorite) and of course there are others. They generally all have the same basic functions. A screen or small openings that bees can not pass through, but can feed the queen and keep her hydrated while she is being housed and is unable to fend for herself. This also provides the worker bees that are tending the queen to sample and then share her pheromones with the rest of the colony - a key part in this process.
There are physical doors that can be opened on the JB BZ and candy tubes or corks that can be removed so she can just walk right out, once enough time has passed and they are ready for her to enter safely without aggression.
The tubes are filled with queen candy (a paste of confectioners sugar & syrup or honey in a straw like tube) for an "automatic" slow release process. This works most of the time, but checking back in a few days is a good idea, occasionally the bees ignore the candy and she stays trapped.
Normally, the bees eat the candy because they like candy, not because they somehow "know" the queen will get out and save the day by laying a few thousand eggs daily. In this way, she is introduced slowly, over a few days time, so the colony will readily accept her and not ball her upon entry to the hive.
JZ-BZ Queen Cage with large opening. The queen cage features a tapered candy tube, large overall opening, and secure closing mechanism for ease in use.