Four factors affect this:
1) The size of the transaction. Smaller transactions get a lower priority. Abnormally small transactions look like spam.
2) The transaction fee. Abnormally low transaction fees may mean the transaction isn't even relayed. Miners have an incentive to include transactions with higher fees.
3) Luck. Some miners don't include any transactions. Some don't include any transactions without fees, even if the fee would normally be zero. So it comes down to who mines the next block or blocks. Also, 10 minutes is just the average. You could create a transaction and then by sheer bad luck the next block isn't mined for 20 minutes.
4) Security. The client 'dribbles' out its own transactions rather than broadcasting them to try to conceal the origin.