The pattern I have noticed is that non-white passengers (such as myself) get checked while white passengers don't; on the other hand sometimes waving a passport (without opening it) from a developed country is sufficient to get past regardless of ethnicity.
I believe we have both seen the same patterns. I was trying to be a bit more thoughtful in my post but since you brought up the issue, yes, the two factors that seem to influence the decision to check documents appear to be the apparent ethnicity of the traveler and the traveler's ability to quickly show a passport from a developed country. It saddens me to admit this reality.