They certainly don't pull up a travel history unless it relates solely to travel into the US (for me I guess it may come up with a list of my recent trips to the US). They can always just look up the passport stamps for this anyway. They can't access information from other countries and nor should they. Again the main reason is to confirm the passport is legit.
Oh and customs open your bags, its immigration that check your passport