Retirement tax questions

How does the IRS know that distributions have already been taxed (after-tax distributions from 401k for example). The before tax distributions need to be taxed by IRS. But, the after-tax distributions have already been taxed.