It has happened to me. They looked through my emails and text messages. It was extremely terrifying to experience.
Anyway yeah, I had to collect my luggage and they then opened it up and rummaged through it. Asked why I wasn't taking a video game console despite ostensibly going to a video game convention. My response was of course that this would be quite impractical.
They then demanded access to my phone and read through my messages. They couldn't find anything other than my friend asking when my flight would arrive and a photo of him holding up a bottle of vodka (he was under 21). I think they just gave up at that point and let me through.
Fortunately I narrowly managed to make it to my connecting flight but it was such a stupid thing to have to go through.