Binary search on the eating speed k. The search space is [1, max(piles)].
For any speed k, you can compute the total hours needed: sum of ceil(pile[i] / k) for all piles. If the total exceeds h, the speed is too slow. If it fits within h, the speed works but might not be minimal.
The monotonic property: if speed k works, all speeds greater than k also work. If k doesn't work, all speeds less than k also don't work. This is exactly what binary search needs.
Search for the leftmost speed that finishes in time.