They know when you don't pay enough, so they have to know what you owe. All of the forms we receive (e.g., W-2, 1099) are transmitted to the IRS. They can use them to determine if a tax payer underpaid.
I know this firsthand because a broker transmitted proceeds without transmitting a cost basis, resulting in a scary letter from the IRS a few months after I filed.
The problem, as I understand it, is that the IRS' technology is very dated, so processing is quite slow, hence the months-long wait between filing and a CP2000 letter.