You said that people gave all 5000 yuan to the exchange when they bought it, which is wrong. In fact, it was given to the stock seller. When the stock fell, the RMB was neither too much nor too little. Yuan You bought 5000 pounds of stock in the hands of the original seller. As for your stock, there is less money on your book now, but on the other hand, there is relatively more virtual money on the seller's book, all of which are virtual. As long as you don't sell stocks, there will be no wealth transfer.
In this way, you will understand that there are two things at first: 5000 yuan and 100 shares. At first, A exchanged 5000 yuan for B's 100 shares. When the stock fell, B still sold 5000 yuan to A, and A still had 100 shares. Is this money or 5000 shares? You mean that A's 100 shares are only worth 4000 yuan, so where did this 1000 yuan go?
For an extreme example, if the stock starts to drop from 0 yuan, A will lose 5,000 yuan and put it in 0 yuan's account. So where did this 5000 yuan go? In fact, it didn't go anywhere. It can only be said that 100 shares are gone and worthless. At this time, we can see that the original 5000 yuan and 100 shares, 5000 yuan is still there, not a penny less, just 100 shares. It is the property, not the amount of RMB, that devalues the stock.
Of course, the amount of RMB has not changed, and the actual wealth has decreased. From a macro point of view, this is inflation, and the same money buys less things.