system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Tickets for a concert go on sale. They sell out within minutes and now they're all on stubhub for much higher prices. Why is this legal!?

The title says it all.

Edit: I suppose I shouldn't have used the word "legal."  I guess I was more just wondering why it's allowed to happen.  It seemed unfair that the tickets are released at a retail level, available to the common public, but they allow bots to swoop up all the tickets before a typical consumer even has the chance to click purchase.  That being said, my question has been sufficiently answered by many of you.  Thanks for the responses!

Edit 2:  For all of the smart asses on here... Yes I understand buying and selling is how commerce works.   But before the Internet there used to be laws against buying and reselling event tickets.  Now it seemed as though people are allowed to eat up all the tickets with a bot and do whatever they want with them.  I was wondering why this is allowed whereas traditional scalping was not.  Most people understood what I meant and provided more than adequate answers. Hence why I marked it as explained.  I don't need anyone else responding that "buying and selling is how the economy works."
gpt
Ticket sales and sell outs are a perfect case of scarcity buying. When tickets go on sale, only a small percentage of the seats are actually sold through the public channels. The remaining tickets are held back for the artist, promoter, venue, record label, etc. The quick 'sellout' then helps to drive the price of tickets higher because people think they are competing for a limited availability item. The holdback tickets are then sold through alternate channels like StubHub, brokers, TicketMaster resale, etc. for a premium based on the perceived scarcity.