A photo can be sent to a thousand people and you still have it. If money were a file, you could pay a thousand shops with the same coin. Any digital cash has to answer one question: when the same coin is sent twice, which payment counts?
The race
The attack is simple to imagine. Alice signs a payment to a shop and, at the same moment, a second payment of the same coins to herself. Both are valid signatures. If the shop delivers before it knows which one the network kept, Alice may leave with the goods and keep the coins.
Banks avoid this because they keep the only ledger. Bitcoin has thousands of copies, so it needs a rule that every copy applies the same way to pick one payment and drop the other.
▶ SEE IT IN THE MACHINEAt NODES, every copy of the ledger checks each block; a block spending a coin twice fails the check everywhere.