Prime Minister Benjamin Netanyahu appears to have bested his challenger, Benny Gantz, in Israel’s third election in a year, and come close to winning a majority.