My impression was that an agent would ask you to unlock your phone and then just randomly scroll through your messages etc until they get bored.
I've heard Russia uses Cellebrite devices at borders, which means cloud-storing an image of your entire device for foreign intelligence agencies to carve up later is possible.