A little more information is necessary to tell you exactly what happened to your transactions that were confirmed "almost instantly" but what you've said is correct:
- The bitcoin protocol is such that new blocks should be mined, on average, every 10 minutes.
- A transaction is "confirmed" (has 1+ confirmation) only after being included in a block. Before this, the transaction is "pending". Some merchants require more than one confirmation for the transaction to be final, many choosing to wait for 3 confirmations before being deemed complete.
However, the situation can arise where after publishing your transaction a block is then mined a few seconds later that has your transaction in it. This could give the appearance that your transaction was confirmed "almost instantly".
Possible source of confusion: Blocks aren't mined 10 minutes after your transaction, they're mined 10 minutes (on average) since the previous block was mined.