Great question and I've always wondered the same. Most likely they can see whatever is in the US Gov't database that is attached to your passport number as scanned. This data and perhaps photo should jive with your presence and arrival statements. Sometimes departures from foreign countries involve passport swipes and my assumption has always been that they input data into one's passport database (ie departing on flight xxx, arrive BOS 12:15PM, etc.), so that they know you're going to arrive and sort of where you've been, but I don't know.
Would appreciate an informed answer to this from anyone who really knows and has or is involved in the process.