Below is one explanation for why this surprise attack occurred. It could be a "biased one-sided story" given the scale and magnitude of attacks Hamas operated. Whether it is an excuse or not, I'm sure with time the purpose of this attack, and who is behind it will come to light.
As for why Five Eyes and Mossad failed to intelligent front. One explanation is that Mossad reduced tons of human intelligence but relied on technology and tech surveillance to react. Hamas's drones and missiles destroyed those surveillance at the beginning of the attack.
Why did the Hamas Attack happen now?
No one is really discussing what sparked this attack by Hamas.
This latest attack was called the "al-Aqsa Flood" by Hamas. This is because the reason given for its timing is Israel allowing "
Jewish groups to desecrate al-Aqsa Mosque”.
Recently, the Israeli government has begun to support extremist Jewish groups attacking and expelling Muslims and Christians from their holy sites.
Extremist Jewish groups like the Temple Institute believe it is necessary to build the third temple on the site of the Aqsa mosque to bring about the Jewish messiah (which many Christians think will be the antichrist).
These Jewish groups have been trying to breed a "blemish free" red cow to fulfil prophecy and bring about the end times, even using advanced embryo selection technology to try and breed this sacrificial cow. Recently, in a further escalation against Muslims and Christians they have been sprinkling heifer's blood on the site.

This year and especially in recent weeks, this antagonism against Muslims and Christians has massively accelerated. Christian churches have been attacked with statues of Jesus desecrated, as Jewish settlers believe they must destroy all religious idols in the land to fulfil prophecy. Over the summer, Jewish settlers occupied and attempted to seize by force Christian churches in Israel. It has also become common for these settlers to spit on and abuse Christians in the vicinity of the holy site, as recent, widely shared footage on social media has demonstrated.

Days ago, dozens of settlers stormed the Aqsa mosque to perform "Talmudic rituals". Israeli forces these religious extremists, expelling Palestinian worshippers from their most sacred holy site.
This is all extremely relevant context that has been left out of this discussion as the whole focus becomes individual instances of violence. The ultra-nationalist Israeli government has been supporting the antagonism of extremist Jewish groups against Muslims and Christians in the Holy Land for years, and this continues to accelerate.