Sorting more than you need
A scheduler must repeatedly pick the highest-priority job. A pathfinder must repeatedly expand the nearest unvisited node. Both need the same operation: give me the extreme element, then let me insert more.
Sorting the whole collection solves it, but does far too much work. Sorting establishes the relative order of every pair, and you only ever asked about the front. Worse, each insertion would require re-establishing that order.
A balanced search tree is closer, and would work, but it also maintains full ordering. A heap is the structure that maintains exactly the amount of order this problem requires, and no more. That restraint is what makes it small, fast, and array-shaped.

