B-Trees and database indexes
PlanetScale on why database indexes are B-trees and not something simpler.
The part worth keeping: a B-tree keeps keys sorted and balanced, so a lookup costs a handful of disk reads instead of a full scan. Range queries - everything between two values - come almost free, because the keys already sit in order next to each other.
That last property is why WHERE id BETWEEN 100 AND 200 is cheap on an indexed column, and why a hash index would not help you there at all.
See also: