Characterizing divergence and thickness in right-angled Coxeter groups