Hamas stationed photographers ahead of time, which shows that they anticipated the following events. The story is then quite simple: Hamas (perhaps in cooperation with other militant groups) sent some of their people to plant mines in the Israeli-imposed "buffer zone" (300 meters wide along the entire Gaza border with Israel). The planters were spotted and an IDF unit moved in for the kill. Two Israeli soldiers were killed by a Gazan sniper waiting for them. There is really little Israel can complain about. According to Israel, and in contrast to UN and almost all other countries' view, Israel no longer occupies Gaza. In this case it has no legal right to impose a "no-go or you are dead" buffer zone. The IDF just has to be more careful in sending soldiers into Gaza.
Two security personnel killed by mine in southeast Turkey (Reuters)
from the article: Hamas footage hints at extent of group's role in Gaza clashes