If you arrive at the US border and you say you're coming into the country for a short vacation and your text messages/email is full of conversations about employment in Seattle and your browser history is full of apartments for rent in Seattle, then they use that information to deny your entry into the country. It's mostly looking for "story checks out" kinda stuff like that.
There's TV shows that follow border agents for various countries during their day-to-day work.
There's TV shows that follow border agents for various countries during their day-to-day work.