Self-balancing binary search tree - Wikipedia

As you add data to a tree it can go from the first example you gave to something more unorganised - this means that searching becomes slower. To overcome this different strategies are implemented when inserting a new item (such as Red/black tree Red–black tree - Wikipedia).

Imagine the difference between a balanced tree and imbalanced tree with thousands of items