The Wikipedia article hints at this. Let me add a few small details which do not seem to be clearly said in that article.
The Palestinians in Gaza made a tunnel 500 metres long. They started 300 metres on their side and came up 200 metres on the Israeli side. Two Palestinians and two Israelis were killed in this raid. Gilad Shalit was captured and taken into Gaza.
Gilad Shalit was a tank gunner. There was at least one tank 200 metres from the Gaza border with Israel. His position was not mentioned in any but the earliest news articles.
I leave the reader to make whatever assumptions you like about the reasons for his capture.