Went to a great Google event where you got a bag only as you left. In fact I wasn't even aware there was a bag until I was leaving and one was nicely passed to me. Had some nice bits to share around the office, and also some things I still have to hand. And a Google home mini - a chunk of the people who came with me moved to the Google home devices after that event, after being amazon people before.
Ah, but you don't know if the bag of tat contains vital information (event schedule, car park code...) until you've already left the registration desk.
You go to the conference registration desk, you tell them who you are. They hand you your name badge, and a bag.
The bag contains various things - printed schedule, lanyard to hang your badge from, and whatever assorted tat the conference sponsors have paid to have put in there.
For some conference attendees the bag is convenient, because when they visit vendors' stalls and get handed leaflets and brochures and free pens; and if they didn't have a bag it'd be inconvenient to carry.
Of course, different conferences have different norms - free-entry trade shows will often offer attendees bags as talking to vendors is the whole point. Academic conferences won't. Fan conventions might or might not, it depends. Beer festivals will offer beer glasses instead. Cosplayers never have visible bags, although they sometimes have giant suitcases.