This has happened to me occasionally (I think usually at IAD). After scanning my passport, my photo (and presumably fingerprints) have come up from previous visits and the CBP official has simply stamped my passport and sent me on my way.
Why doesn't it always happen? CBP has wonky software and it only works on even days when the wind is blowing in the right direction? The CBP official hasn't been trained properly? Could be anything.