Rainbow tables are essentially large databases of precomputed hash values. When a hacker obtains a hashed password, they can quickly search through the table to find a match, revealing the original password. This method is much faster than traditional brute-force attacks, which try every possible combination.