Hash passwords bare and two users with the same password get the same stored hash — and an attacker precomputes a giant table (a rainbow table) once and cracks everyone. A salt is a unique random value stored alongside each hash and mixed in before hashing: H(salt ‖ password). Now identical passwords produce different hashes, precomputation is worthless (the attacker must redo the work per salt), and identical-password users are no longer visibly identical. It is a relabeling of the hash input, cheap and mandatory — the difference between one break and a million separate ones.
The demo hashes the same password bare (identical hashes) and then with two different salts (different hashes) — precomputation defeated: live demo
“Hashing the password is enough.” — bare hashes collide across users and fall to one precomputed table; a salt makes each unique. cited
A unique pinch per password — the same secret stored a million different ways, one table for none of them. encoding
On the canonical compiler, the bare password hashes identically both times; two different salts give two different hashes: