In-depth: Israel has failed in its objective of destroying Hamas, with the group likely to retain influence in post-war Gaza but not be its sole ruler.