I don't think it involves memorization, but my guess would be it is tied to the handing in of tickets and cards at the outset, an earpiece, and superb timing by him and his backstage staff. Don't have any insider knowledge, though my husband has done professional magic for fifty plus years.