Follow the photos below as I explain. As the first photo shows, if the rope goes from the belayer, through the carabiner, is against the rock, and tied to the climber, then the leader is backclipped. If the leader falls, the rope will be pulled across the gate, as in the middle photo. And consequently, the rope easily comes out of the carabiner. This rarely happens with straight gate biners (in fact I've never heard of it), it's the bent gates you have to worry about.
If the carabiner is clipped correctly, the rope should go from the belayer, against the rock, through the carabiner and back to the climber. Ideally you should also have the gate facing the opposite direction the leader is going. Meaning if the climb veers to the right, then the gate should be on the left so that the rope falls against the back of the biner, as shown in the photos below.
When the leader discovers they've backclipped he or she has a few choices about what action to take. If they are not too pumped then they should reclip the rope. The other choice is to simply unclip from the wall and reclip it to the bolt (however then you risk the chance that the gate is not facing the right way). Or if the climber is completely rushed they can clip a second draw to the bolt correctly (on top of the wrong one) and continue to climb.
Backclipping is something we all should look out for. Sometimes the leader is too focused to notice and the ground crew should alert him or her when they have backclipped. Remember, we're in this together so make it your job to look out for your partner as well as yourself.