Without an index, the only way a database can answer WHERE dept = 'Sales' is to check every single row, one at a time — a full table scan. That's O(n) work regardless of how selective the condition is, and on a table with millions of rows, it's the difference between a query returning instantly and one that takes seconds. An index trades a small amount of extra storage and write overhead for the ability to jump directly to matching rows instead of inspecting every one.
CREATE INDEX idx_employees_dept ON Employees (dept);
This creates a sorted structure of dept values, each pointing back to its corresponding row, so WHERE dept = 'Sales' can jump straight to the matching entries instead of scanning the whole table — the same reason a book's index lets you jump to a page instead of reading cover to cover.