Imagine you need to rearrange characters so no adjacent ones match. The greedy approach is: always place the most frequent character next, but never repeat the previous placement. A max-heap gives you the highest-frequency character in time.
You'll also learn to detect impossibility early: if any character appears more than times, no valid arrangement exists. Amazon's task scheduling systems face the same constraint when distributing work across servers without overloading any single node. This greedy + heap pattern transfers to any spacing constraint problem.