A shareholder is a person or organization that owns one or multiple shares in a corporation. Collectively, the shareholders own the company. The more shares of stock a shareholder owns, the greater voting strength they have at shareholders meetings, provided of course, the class of shares they own comes with voting rights.
Some companies will issue a second class of shares which does not come with voting rights. This allows a company to attract investment without diluting the controlling interest in the company.
All shareholders, no matter the class, have invested in the corporation, which means they can earn dividends or see their share price rise as the corporation profits but can also lose their investment if the corporation fails.
If a shareholder invests in a corporation that goes bankrupt, the odds are they will see little return on their investment as secured creditors such as banks and bond holders are always paid first by the liquidator, followed by unsecured creditors, and then equity holders.