The ladder runs administrative and secured claims, then priority unsecured, then general unsecured, then preferred-stock, then common-stock. A junior class can only receive value with the consent of the senior classes above it, which sometimes happens as a small negotiated gift to buy a consensual plan and avoid litigation.
This is the rule that explains why a bankrupt stock's price is usually pure option value on a recovery scenario that the capital structure does not support.
Example: enterprise value in the plan is $700M against $650M of secured debt and $400M of unsecured. The secured class is made whole, unsecured recovers $50M on $400M, and equity receives nothing because the class above it was not paid in full.
Related: chapter-11, chapter-7, preferred-stock, common-stock, plan-of-reorganization