“Those who vote for other parties and wear a skullcap are cutting themselves off, and the next generation will not be there,” he added. Like many in Modiin Illit, he carried only what he called a “kosher” cellphone, a basic model for only making or receiving calls, not a smartphone with internet access. Those are still scorned by the most strictly observant.

For the first time, an ultra-Orthodox woman, Omer Yankelevich, will enter the Knesset on the centrist Blue and White Party roster, led by Benny Gantz, a former military chief.

Israel Cohen, a political analyst for the ultra-Orthodox radio station Kol Berama, said that Ms. Yankelevich would have little influence (some Modiin Illit residents had not heard of her) but that the mainstream parties wanted to reflect the diversity of Israeli society, “like in a reality show.”

In the past, the ultra-Orthodox were swing parties, willing to join left-wing or right-wing governments. Their leaders were amenable to peace with the Palestinians and at first were reluctant about settling the West Bank.

In recent years, they have stuck with the right.

“Today there is no diplomatic solution on the table,” Mr. Cohen said, “and the left has adopted anti-religious positions like the recognition of Reform Judaism and civil unions.”

“You can have a smartphone, a television at home, your kids can go to karate, but at the end of the day what are you? Haredi or not?” he said. “With all the advancement, in the end people still listened to the rabbis.”