What did he actually gain by murdering Fredo? People being more terrified of him?
Michael is a thoroughly reprehensible character. In his mind, if he showed any mercy or forgiveness to anyone who "injured " him--even his own brother-- (as he put it to Cardinal Lamberto in III), it would be viewed as a sign of "weakness" by enemies and friends alike--and would endanger his life. "This was the business he chose."

Everyone - Barzini, Roth and others in “The business they've chosen” is a “reprehensible character.”
Vito and Michael were thrust into it and sure became “reprehensible characters” too. They
had to, for survival -- Kill or be Killed
Michael showed understanding "mercy and forgiveness" to Fredo
until Fredo's boathouse outburst
Fredo unlike Michael
no remorse
no regret
Just more anger, jealousy, resentment that Michael survived the Tahoe bedroom shooting and Michael was too smart to let anyone beat him – Roth, Senate committee and Fredo himself
Nobody could “get rid of Mike” and the Donship, Fredo so coveted, Don Fredo Corleone, didn't eventuate Slipped away
Fredo, to the bitter end "I'm your older brother Mike and
I was stepped over!" and still “It ain't the way
I wanted it!” even
after Fredo was complicit in
1. Michael and Kay's bedroom machine gun sprayed, nearly resulting in Michael and Kay being killed
2. Michael's Senate hearing - indictment for perjury, at the very least