Israeli troops had for more than a year hunted the leader of Hamas, who disappeared in Gaza soon after masterminding the 7 October attacks.