An ESOP is a tax-deferred retirement plan with significant tax-favored features. An ESOP has looser diversification requirements than a 401k and can invest the majority of the plan in the stock of the corporate employer. Many companies use it as a device for the employer match of employee contributions to a 401k plan.
Employer stock received as a distribution from an ESOP receives basically the same treatment as employer stock received from a 401k plan.
When taking a distribution of stock directly from the ESOP, the cost basis of the shares inside the ESOP (i.e. what the ESOP paid for the stock) is taxed as ordinary income to the recipient. A powerful tax savings feature of ESOPs is that the difference between the cost basis and the fair market value of the shares on the date of distribution, called the "net unrealized appreciation," is not taxable until the shares are sold. Then at the date of sale, it receives capital gain treatment at tax-favored rates. The employee not only defers payment of the tax, but also saves the difference in tax between ordinary and long-term rates (up to 25% under current tax rules.)
Even if the shares are sold immedately by the ESOP on behalf of the participant and cash is distributed, the net unrealized appreciation rule is still beneficial to the participant. The cost basis of the shares inside the plan appears in Box 2a of the Form 1099-R as ordinary taxable income. The net unrealized appreciation appears in Box 6 of the Form 1099-R and receives long-term capital gain treatment.
What happens if the ESOP shares are rolled over to an IRA? The shares then lose their character as ESOP shares and any future distribution of the stock is taxed under regular IRA rules. That means the future distribution of the shares of stock is taxed as ordinary income and the cost basis of the stock becomes the fair market value of the stock on the date of distribution from the IRA. So it is a big "no-no" to roll ESOP stock into an IRA because you end up turning capital gain income into ordinary income. Ouch!