The most important factor needed to get a ball out of a sand trap is the follow through. A full finish should be achieved each time after hitting a bunker shot. This helps maintain the forward momentum of the club and reduces the chance of deceleration through the ball.
When a club hits sand, the club head will slow drastically. Any type of deceleration just prior to impact will thus be magnified to the extent that the club could stop dead or at least not hit the sand with as much force as intended. Either of these outcomes will result in not enough force being applied to the sand immediately behind the ball to propel it from the bunker.
Remember: Club hits sand, sand hits ball, ball leaves bunker. To hit a sand shot like this it is absolutely necessary to maintain acceleration through the shot (especially the point of impact) and as such a proper follow through will ensure your ball gets up and out!