Chapter 7 bankruptcy is sometimes also called liquidation bankruptcy. Firms experiencing this form of bankruptcy are past the stage of reorganization and must sell off any un-exempt assets to pay creditors. In chapter 7, the creditors collect their debts according to how they loaned out the money to the firm (also referred to as the "absolute priority"). A trustee is appointed, who ensures that any assets that are secured are sold and that the proceeds are paid to the specific creditors.
For example, secured debt would be loans issued by banks or institutions based upon the value of a specific asset. Whatever assets and residual cash remain after all secured creditors are paid are pooled together to be paid to any outstanding creditors with unsecured loans: e.g. bondholders and preferred shareholders.
Chapter 11 bankruptcy can also be called rehabilitation bankruptcy. It's much more involved than chapter 7 as it allows the firm the opportunity to reorganize its debt and to try to re-emerge as a healthy organization. What this means is that the firm will contact its creditors in an attempt to change the terms on loans such as the interest rate and dollar value of payments. Like its cousin, chapter 11 requires that a trustee be appointed; however, rather than selling off all assets to pay back creditors, the trustee supervises the assets of the debtor and allows business to continue. It's important to note that debt is not absolved in chapter 11: the restructuring only changes the terms of the debt, and the firm must continue to pay it back through future earnings.
If a company is successful in chapter 11, it will typically be expected to continue operating in an efficient manner with its newly structured debt. If it is not successful, then it will file for chapter 7 and liquidate. In both instances, common shareholders will most likely see little (if any) return on their investments.
To learn more about bankruptcy, check out the articles An Overview Of Corporate Bankruptcy and Z Marks The End.