ELI5 where does stock come from?

I understand what stock is but who creates it? Does it come from a company or do brokers create it as a way to gamble on a company?

Edit: thank you to everyone for such detailed answers. You’ve all been awesome.