DP - reduce a number to 1 in min steps

How do we know that greedy solution would not work in every case in this question ? I mean at the time of exam , on seeing such question , our first thought would be to use greedy approach only.

Why do we have greedy algorithms when they dont give 100 percent correct ans in any q. ?