Bitcoin transactions are saved in a ledger. There needs to be a way for everyone to agree on the same ledger. In bitcoin this is done by making sure that the only valid ledger is the one where more computing power was put into it to "generate it". There's a lot of other details, where the ledger is actually a block chain, but overall the idea is that of "the most computing power" is the rule behind how nodes accept the main ledger.
With this in mind, it still could happen that someone with a large amount of computing power may create a ledger that replaces the one that is currently accepted by the network. Because of how the block chain works, this is exponentially harder to do for every block in the ledger that is generated/found.
So to answer your question to "why is it that we need to wait for 5-6 confirmations", it's because a malicious party with lots of computing power could hypothetically replace the latest 2 blocks or so. But, to replace the latest 5 or 6 blocks it becomes so hard that it's virtually impossible for it to happen. Therefore, a transaction without any confirmations is "less secure" than a transaction with 5 confirmations. The more the confirmations, the more secure a transaction is.
2Note that it is not actually necessary for both parties to be online at the same time. You can create a transaction offline, and give the transaction data to somebody else to submit to the Bitcoin network (the transaction is signed by you, so the other person can't change it). After it is submitted and included in the blockchain, the coins have been transferred and it is not necessary for the receiver to be online at all. Any third party can see the complete transaction in the blockchain. – Greg Hewgill – 2015-05-17T21:14:10.953