Striking Iran didn't end hostilities in Gaza, Trump leaning on Egypt, Turkey and Qatar did [1]. (The Iran strikes might have worked because Hegseth was sidelined [2].)
Hegseth is a wuss who couldn't cut it in the military. He's in place because he's loyal, probably compromised, and plays masculinity well on TV.
[1] https://www.wsj.com/world/middle-east/a-coordinated-squeeze-...
[2] https://newrepublic.com/post/197005/trump-iran-plans-hegseth...