Shares are traded both on stock markets and privately. Essentially they give the owner a share of profits of the company that issued the share. The certificate of ownership is commonly known as a security. Originally these were paper based certificates but today the records are more commonly recorded electronically.
From time to time, typically annually a dividend is issued (profit distribution) and broadly speaking, shareholders receive a portion of that profit, in proportion to the number of shares they own. In addition a shareholder will receive a share of any assets left over in bankruptcy that is after other creditors have had their claim.
In addition to holding a share and receiving dividends, the other way people profit from shares is to trade them on a stock exchange. Put very simply, you buy 1000 shares in Company-X, each share costing £1. You hold the shares for a while and then sell them at £1.50 a share, hey presto £500 in profit. (ignoring trading cost for now), simple. But why would someone pay 50% more than you paid for the same asset? The answer is, on the whole, because the market said that the stock is now worth more than it was.
There are only a limited number of the shares you own – the company can’t just issue more shares without permission from the people who already own them. Like any other limited resource they are subject to the effect of supply and demand. Say the company you own shares in have historically produced high profits or are expected to see a sudden jump in profits. May be because of the imminent release of the latest greatest gadget, then more people are willing to pay more for that share and so the free market price rises. And you make £500, well done!
Of course the price of your shares could go the other way and you could potentially make a loss, the real key here is that shares go up and down all the time but you only make a loss when you sell at a price lower than the one you bought at, this is called crystallising a loss, when you sell is entirely up to you. It also points to the fact that the best strategy for growth is to look long term at reliable slow growing stock. That is not to say you can’t punt riskier investments but you need to understand the risk you are taking