In simple terms, the money you invest in a business (and let’s say that you buy the stock as an IPO) is used by the business to grow itself. That is, the company invests in plant, equipment, labor and technology to make and sell a product or service. You certainly understand that.
The business, if it will be successful, has to earn a profit, which it annually either returns to the stockholders in the form of dividends, or retains and puts back into further investment (probably in itself, but not necessarily—the business can make its own outside investments), or some combination of dividend return and retained earnings. Since most business owners are reluctant to give up control of their companies, the owners (or ‘the business itself’) retains a large portion of its stock for themselves.
Over time, the company continues to expand, modernize, re-invest and make more profit, and the compounding of that growth and profit can make even small companies into quite large companies, even if they don’t have the wild success of a Microsoft or Google, to name a couple of recent ‘wild successes’. (Note that we haven’t yet discussed the trading of that IPO that the original investor purchased.)
As this growth of the company occurs, since it is a public company, the facts of the growth are available knowledge to any potential investor, which is why the value of the stock fluctuates over time. Investors recognize the utility of the company’s products and services compared to their competitors and compared to what the market “needs” from time to time and bid the stock up or down accordingly.
So in terms of your example, if the stock has doubled in value over 5 years, then that is because the market has apparently viewed the stock (that is, the company whose fractional ownership is represented by the individual shares) is worth twice as much as it was on the day she bought it. There’s no telling what will happen to the next investor; that depends on the company’s management, its products, and to the overall economy in which it operates. But on the day of the sale at $2000, “the investing world at large” has set a value of twice the original investor’s stake.
To answer one of your later questions in the thread, the value has been created over the entire 5 years, not just when the stock is sold. (That is also true even if shares are never sold; the ‘value’ is there; it’s available as collateral for loans and for determining one’s own net worth, for example.) That value is “realized” or cemented, when the stock is sold, but the value is there every day that the stock is owned.
I didn’t want to get into such a lengthy explanation of your question on “natural resources”, but I will say that “undeveloped” natural resources are merely potential, and not actual value. For example, there’s probably more oil in the deep seabeds than we can even imagine, but for now it’s essentially useless, because no one has the technology (or the means of establishing ownership rights) for mid-ocean drilling.