Say your transaction is in block number n; as more and more proof of work is added on top of the block n (by means of block mined on top of it) the probability that someone proposes a longer chain that does not contain your transaction at block height n decreases as blocks are mined on top of block n.
This is due to the fact that whoever wants to propose an alternative chain that differs from the active chain starting from height n, has to provide valid proofproofs of workswork for every block starting from n, before someone further extends the active chain, which happens on average every 10 minutes.
Each confirmation is a valid block mined on top of block n; confirmations make what is written in n harder and harder to change as time passes.