The first time my transaction is included in the block and hashed by the miners I get a confirmation. What does the second confirmation mean? And the third and so on?
From
https://en.bitcoin.it/wiki/Confirmation (emphasis added by me):
After a transaction is broadcast to the Bitcoin network, it may be included in a block that is published to the network. When that happens it is said that the transaction has been mined at a depth of 1 block. With each subsequent block that is found, the number of blocks deep is increased by one. To be secure against double spending, a transaction should not be considered as confirmed until it is a certain number of blocks deep.
tl;dr number of blocks (within the currently dominant chain) the transaction exists in.
EDIT: By "exists", I mean that if you took the entire dominant chain at a certain number of blocks and parsed it (e.g. in Bitcoin wallet app), the transaction would be included in some block within that chain (either the newest or any older one). So if, hypothetically, your transaction was included in block 5 in the dominant chain and the newest block is now 6, your transaction has 2 confirmations since it "exists" in blocks 5 and 6.
I didn't understand what you said.
Completely understandable. As you've mentioned, you understand that when a miner includes your transaction in a block, it has 1 confirmation. Well, these blocks aren't free floating. Each block references (points to) a different block in the past essentially saying "I'm building on top of this block". So if you took some sort of recently mined block and started going backwards (block X points to older block Y which points to an even older Block U) you'd get a
blockchain. However, since the entire system is decentralized (there is no definitive be-all-end-all authority), as long as a blockchain matches the rules of the Bitcoin protocol, it's considered valid. As such, whenever I'm talking about the "dominant chain", I'm talking about on blockchain that matches the rules and is the longest one publicly available.
However, nobody is stopping someone from taking an existing blockchain, taking
not the newest block in it and starting to secretly mine blocks on top of it (essentially making his own private branch, like in a tree). If he manages to produce a longer branch than the currently "dominant" one and then reveals it by broadcasting it to the public, most clients (wallet apps, miners, explorer websites, etc.) will switch to that branch. Meaning that if your transaction was mined / included into a block that only exists in the old branch, it will suddenly become unconfirmed again. This is why most vendors wait for 6 or so confirmations before they consider the payment as received. Beating the rest of the network mining on top of an already public chain with your own private branch requires tons of resources and keeping it up for several blocks increases that resource requirement immensely. Meaning the more confirmations there are, the smaller the chance your "confirmed" transaction becomes unconfirmed again.
Here's a crude ASCII illustration of the situation:
____(public blockchain branch)_________
/
-----(main blockchain)-----
\_____(secret private blockchain branch)___
Before the private chain is revealed, the public only knows of the (main blockchain) + (public blockchain branch). To them there are no branches, just a single blockchain. However, someone else has secretly started mining blocks from a certain block in the (main blockchain). To them, there are 2 branches, one that the public continues to mine on and then his / her own secret private branch. These 2 go at it until either the private branch miner gives up or till (like seen in the illustration) he manages to beat the public branch in the number of blocks and (usually) decides to reveal it. Once that happens, most clients will switch to the (secret private blockchain branch), abandoning all blocks within (public blockchain branch).
If, within this illustration, your transaction was mined in a block that is within the (main blockchain) part, your transaction is still confirmed. However, if it is only mined in the (public blockchain branch) and wasn't also included within a single block in the (secret private blockchain branch), once the network switches over, your transaction will yet again be unconfirmed.
Going back to the question, your transaction's data / information isn't included in every single block - it's included in a single block (1 confirmation). A new block is mined that points to that block (2 confirmations). An even newer block is mined and points to the new block that points to the block your transaction is in (3 confirmations). Repeat ad nauseam. When you're paying a transaction fee, that fee gets received only by the block that included your transaction. So when estimating what fee you should pay, the wallet application uses historical (previous blocks, confirmed transactions, their fees, etc.) and current (unconfirmed transactions known to the wallet app, etc.) data to, for example, estimate a probability that your transaction gets included in the next block or in one of the next N number of blocks. Different wallet applications and websites use different algorithms to calculate these numbers so their predictions differ.
Do note that I'm severely oversimplifying, using a lot of non-standard terms, skipping over a lot of small (yet important) details and that I'm not an expert in the exact low level details of how it all works.