For example, men coming back from Thailand or some other countries in Asia are particularly scrutinised at times. It's just part of 'profiling'. Perhaps they suspect you're a drug courier (been there, had that accusation!), or just your travel pattern is weird to them or you seem 'nervous' to the officer when your passport is being checked.
I think a lot of the regulars here would have travel patterns that looked odd! I whip around the world in a few days going twice as far as an efficient itinerary would dictate, for example. Flying from Los Angeles to Canberra via New York and Perth is par for my course.
I never bother trying to work out the codes. I rely on having a pure heart. I might have a bag full of Tim Tams on the way out and weird foreign lollies on the way back, but that's about as far as it goes.
The one time I got into any trouble was the last trip coming back from New Zealand, when after a wine tour on the previous day I had five bottles of wine in my bags. I knew the Kiwis would let you in with six bottles, so I figured Oz was the same. Declared them and found that I was one over. The customs guy just waved me through anyway.
The beagle also picked out my carry on for a check while waiting at the carousel. I saw the dog coming so I pulled my small bag out of the mesh basket so he wouldn't have to jump up for a sniff. Blow me down if he didn't react!
I had to start pulling stuff out. Didn't empty it completely but the only thing dodgy in there was a pair of (TMI alert) lightly soiled undies, which I suspect was the result of putting my head under water at Hanmer Springs in the hot bacterial soup.
When I got my bags - after disappearing into the gents for a welcome break - and presented my card at the customs line, the bloke there, not the dog handler, wanted to know what the dog had reacted to. So they obviously keep an eye on passengers and behaviour out of the ordinary.
It'd be a pain if I was detained in a tight connection. I see all these poor schmucks on the Borderline Security show trying to smuggle in frogs guts or having bags that smell funny, and they get pulled aside and strip searched and have their relatives rung up and stuff, and if you knew the last plane of the day was leaving from the other terminal in half an hour you'd be sh*itting bricks too!
Speaking of bricks, I'm very very sorry I didn't bring back a few blocks of that Whittakers White Macadamia from New Zealand. It doesn't seem to make it onto the choccy shelves at my Coles. For family consumption, of course!