That's not really accurate. Stock is regularly bought and sold from the company itsself. It exists to get people to give them money in exchange for an IOU and the potential to control the company you invest in. Sure, people buy and sell stock from other people, but realistically all that does is change who the IOU and potential company control is owed to. All the stock came from the company initially.
IE: Big Company gets big enough (or just wants investment) so it sells stock. People buy that stock. They may trade that stock around, but those stock papers still represent an investment in the company. Trading it between private individuals just means it's owed to Joe instead of Bob.