Wealth is created by someone's effort, but it may also be created by someone's non-effort. In other words, it may be created by the use of someone's capital by someone else. If you tend a garden and grow vegetables and package them for sale, you've made an effort that creates tradable wealth. If you can't get the vegetables to market, I own a wheelbarrow you can use, without which that wealth would be lost. Or diminished, based on the limit of what you can carry. I've done nothing except own the wheelbarrow, yet its existence makes the market function better so that wealth is conserved, distributed more equitably and thus more profitably. (Without it your immediate neighbours would tire of buying your vegetables, they'd pile up, and your distant neighbours would scrimp with a few old carrots.) Thus the wheel barrow is as much a real input to procure our wealth as is your labour in the garden.
This doesn't change your equation; someone's mental effort a long time ago to design the wheelbarrow, and their one-time effort in making it, has created a device that pays continuing dividends to the gardener. But it is necessary to point out that wealth can take the form of something other than labour, and it can be owned by someone other than the person doing the labour. And also to emphasize the concept of capital assets being contributors to wealth.
Beyond just labour and capital assets, markets are contributors to wealth, because they enable the efficient exchange of things you have but don't want for things you don't have but want.
A market is also the creation of someone's effort: primarily that of Adam Smith, and the other thinkers, philosophers, economists, and merchants of the Enlightenment. The idea of the open market continues to pay dividends and create, preserve and distribute wealth in a way which power our prosperity to this very day. Smith or his direct heirs see no special benefit from this brilliant idea; in polite company it was bequeathed to us all, or at least stolen by us all for our own benefit with no commission going to Smith.
Or was it? With just an idea, nothing would have happened and Smith would be forgotten. But with all of us bringing that idea to life, Smith's idea gained value. This it is our efforts that bring the idea of the open market to life, and from which we are justly entitled to a benefit.
Incidentally, people buying stock enable production. If I buy stock in a new company making harvesting equipment in a new factory, you would be well pleased by the toil saved and motivated to trade with me for the tools. If some speculative investor comes along and offers me double what I put into it, he also enables production. At first, to justify his purchase costs, he ups the cost of equipment and creates a hardship for your farm and forces you to charge more for your vegetables, which displeases you and your customers. But then I've doubled my money, and I invest in a supermarket and a paving company and soon your vegetables are selling so fast you're looking to plant more fields. By now the cost of equipment is in perspective again, and we're all making so much money that we can hire truly obscure pointless positions like "marketing researchers" and "lifestyle analysts" and "professors of agronomy."
Except they're able to tell us that artichokes grow just as well as onions and there is enough demand for me to convert half my shelf space from onions to artichokes, and their abstract and intangible efforts, and the investor's money, and Adam Smith have all given us more wealth.
But there is one other precondition for the open market to work: a stable society. We all inherit a share in that society by the act of being born. And to the extent that we contribute as members of society, we are justly entitled to a dividend from its wealth, just as surely as I am entitled to a return on my wheel barrow when you use it to take the onions to market. That is the basis for our just use of social amenities; public education, public health care, public lots of stuff: we own the wealth that arises from our being born into a stable society. It is our own wealth that pays for this stuff.