What is the difference, in that example, between someone who moves through the secret trapdoor and goes elsewhere and then sits there using his action to hide, and someone who moves through the secret trapdoor and goes elsewhere and sits there without using his action to hide?
The hide action is part of the 'moving elsewhere quietly while unobserved and sitting there'. What you're describing is the Magicians assistant using the Hide action (while he cant be seen, he slinks off to a hiding spot quietly).
Normally (if the assistant gets in a box with
no trapdoor) he cannot attempt the Hide action once he closes the lid. The crowd know where he is (they watched him hide in the box).
He can be as quiet as he wants in that box, but it wont change a damn thing. A few seconds pass, the magician opens the box, and the assistant is still in there.
No one is shocked. At no stage was he hidden (or even allowed to take the Hide action) even though he had total cover relative to the crowd. The crowd saw him go into hiding. No Hide action allowed (I mean... he can roll Stealth to be quiet in that box if he wants, but he wont be
hidden. The DC is infinity).
Now assume the assistant gets in a box containing a secret trapdoor and closes the lid. He then announces to the DM that he wants to use the secret trapdoor at the back of the box, open it quietly and crawl away behind a curtain placed there for just this purpouse.
The DM agrees that
he is not being watched going into hiding in this case. The Hide action is allowed.
If he succeeds on the Stealth check to Hide (beating the passive perception of the crowd), he pulls off his trick (and the crowd go wild). If he fails his Stealth check, he doesnt succeed (someone in the crowd notices him ducking out the back of the box, or hears him open the trapdoor, or notices the curtain ruffling as he slinks off behind it).