When you buy a share of stock you are part owner of a corporation. As part owner, the company’s land, buildings, machinery, inventory, debts and earnings belong to you (and the other shareholders.)
The corporation, not you personally, is required to pay taxes on its earnings, pay its debts and other things.
But you are protected when you own stock. For instance, if your company gets sued and must pay more than it has, the law cannot come to you, one of the owners, and confiscate your house or other property. The value of the shares may decline until they become worthless, but that is all you can lose.