Why is this not recognized by a DFA?
The actual claim is that there is no DFA for the language $\{p^kq^k\mid k\geq 0\}$. Such an automaton would have to accept every string of the form $p^kq^k$ for any&nbsp;$k$, and reject every other string.

For any one fixed value of&nbsp;$k$, you're absolutely right that you can use $2k$ states to count off the $p$'s and the&nbsp;$q$'s. However, to recognize the language, the automaton would have to be able to do this for infinitely many different values of&nbsp;$k$, which would require infinitely many states by this method. Of course, that's not allowed in a deterministic finite automaton.

Note that this isn't a formal proof that no DFA can accept this language; rather it's just an intuition about why you should expect there to be no DFA. To formally prove the claim, you'd have to use something like the pumping lemma or Myhill&ndash;Nerode; we have a reference question about how to do that.