KORAT, Thailand — It was an important Buddhist holiday, so the back gate to the forest temple was open. And it was the perfect place for an ambush.

A Thai soldier who had already killed three people drove a stolen military Humvee to the temple grounds and parked inside the gate, partially hidden by trees. Two monks who were raking leaves saw him, assumed he was there for some military purpose, and continued their raking.

The soldier’s deadly rampage on Saturday had started as revenge against specific people he thought had wronged him. But at the temple, Wat Pa Sattharuam, it turned into something much bigger and more sinister. It was here that he began gunning down random strangers, including children.

All told, Sgt. Major Jakrapanth Thomma killed 29 people and wounded 58, most of them in a shopping mall he went to after the temple, leaving Thailand in shock and mourning. Unable to shake the images in their minds, survivors ask what could have motivated him, and wonder why they were victimized or why they were spared.