Spells aren't instant. They take time to move from the end of the wand to the target. The 6th book explained that an experienced wizard/witch can anticipate and 'know' what the next spell the opponent will use and with then cast a deflecting spell accordingly.