Israel has also invested hugely in intelligence, its tactics evolving as its enemies change theirs.

Several psychological studies in Israel have found that people habituate quickly to threats, making adjustments to daily life — keeping children at home, for example, rather than sending them to summer camp — and adopting dark humor about the randomness of the threat.

“If I don’t get blown up, I will meet you at Dizengoff Center in about 45 minutes,” a Tel Aviv bus rider told a friend over a cellphone, in a conversation overheard by Israeli psychologists researching the aftermath of the second intifada.

The survey of 458 people, led by Yechiel Klar of Tel Aviv University, found that 55 percent had changed their behavior — spending less time outside the house, for instance, or making fewer long trips by public transportation. The other 45 percent said they had made no changes.

A separate study, done in 2003-4 at Ben Gurion University, found that residents close to attack sites — in this case, those living in Israeli settlements then in the Gaza Strip — reported a lower sense of personal threat and stress than those in two other communities, one in a Tel Aviv suburb and one in a larger settlement near the occupied West Bank city of Hebron. The research suggested that the religious fervor of the Gaza residents might have been a key factor.

Some Israeli politicians have been disparaging about what they view as European negligence in security matters. After the attacks in March in Brussels, for example, a senior minister, Israel Katz, said Belgium would not be able to fight Islamist terrorism “if Belgians continue eating chocolate and enjoying life and looking like great democrats and liberals.”

In a radio interview on Sunday, Yaakov Perry, a former Shin Bet chief now in Parliament, recommended deeper intelligence supervision of neighborhoods “where Muslims, refugees, Daesh supporters of various sorts live,” using an Arabic acronym to refer to the Islamic State. He also suggested that the French police were complacent, referring to news reports that the driver in Nice had told officers he was delivering ice cream. “If the driver says he has ice cream, open the truck and check if he has ice cream,” Mr. Perry said.

That the attack occurred at a mass gathering for Bastille Day, France’s national holiday, had Israelis shaking their heads. Micky Rosenfeld, an Israeli police spokesman, said that to secure a major event like Independence Day celebrations, when tens of thousands of people gather along the Tel Aviv seafront to watch an air and naval display, officers gather intelligence for weeks beforehand, and erect a 360-degree enclosure of the area, with layers of security around the perimeter.