appears whenever you repeatedly divide the problem size by a constant factor. The most common pattern is halving.
Start with items. After one step, you have . After two steps, . After three steps, . After steps, you have items left.
You stop when you reach item, meaning . Solving for : , so . That's where the logarithm comes from.