Shareholders are not liable for the debts of a company they own shares in (with certain very limited exceptions which are not relevant to shareholders in listed companies). This is limited liability.
Apart from the obvious consequence (shareholders cannot lose more than what they actually put into buying shares), limited liability greatly affects the valuation of both equity and debt.
Limited liability means that debt holders have no recourse other than to a company's own assets (except where explicit guarantees have been given, or other special circumstances exist). This simplifies the valuation of debt, although it reduces its actual value.
Limited liability also creates an agency problem by creating a conflict of interest between shareholders and debt holders. Shareholders can, in effect, walk away from a failed company, leaving creditors with its assets. This means that by following a more profitable but riskier business strategy shareholders can benefit at the expense of debt holders.
For the same reason, limited liability also means that shares can (although they rarely are) be valued as options — shareholders can pay debt and keep the profits, or they can walk away (in effect, exercise a put option) leaving the assets and business of a company (the underlying security) to its creditors.
As well as their usual use to incorporate businesses, limited liability companies are used for securitisation and for raising non-recourse finance. In these circumstances they are called special purpose vehicles or special purpose entities.