How does a B-tree index work in databases?

Technical