I have been told that a 51% attack is very dangerous, what does it mean then?
I thought that double spend also was possible with 51% of the bitcoins.
Let's say that we have the following blocks:
A1 -> B1 -> C1 -> D1
but then someone with >50% of the hashing power creates this:
A2 -> B2 -> C2 -> D2
and the rest of the network agrees that the second set of blocks is both *valid* and *superior* (in terms of POW) than the first set.
So now A1..D1 are *discarded* and replaced with A2..D2 (what came before A1 and A2 is identical and therefore not of concern in terms of any change).
What this could mean is that txs that were valid (with 3 confirmations) in A1..D1 are now no longer valid after the re-org.
This is why you are recommended to wait for confirmations (the more value you are risking the more confirmations you should wait).