If $A$ is invertible and the Krylov subspace $v,Av,A^2v,\ldots$ stops to expand after $m$ steps, then GMRES (and other reasonable Krylov methods) converge to the exact solution in at most $m$ steps (assuming exact arithmetic).
Proof:
The minimal polynomial of $A$ is a minimal-degree $q$ such that $q(A)=0$. Always $m\ge n$.
From http://www.maths.lth.se/na/courses/NUM115/NUM115-05/krylov.pdf p.~5 we get:
Lemma Let $m$ be the degree of the minimal polynomial of a nonsingular $A\in C^{n\times n}$.
Then $A^{-1}=\sum_{i=0}^{m-1}\alpha_i A^i$. Thus, $A^{-1}b=\sum_{i=0}^{m-1}\alpha_i A^i b\in K_m$.
Moreover, $m=\sum_i m_i$, where $m_i$ is the size of the biggest Jordan block of eigenvalue $i$.
By the lemma, then $x\in K_m$, QED.
However, generally $m$ is close to $n$ (and $m=n$ for almost all random matrices), so that is not the reason why GMRES is good.
By my superficial Matlab tests, Krylov is no better than a random subspace, for random $A,\ b$.
Thus, GMRES (and other Krylov methods) need preconditioning, unless the matrix happens to be nice. However, in practice it does usually or at least often. Nevertheless, preconditioning is usually crucial for quick enough convergence.
Convergence depends on eigenvalues. If eigenvalues are in a tight bundle (or most eigenvalues relevant to $b$ lie in a number of tight bundles), then Krylov methods for $Ax=b$ tend to work well.
However, some methods, like IDR(s) or BiCGSTAB do not like very nonreal eigenvalues for real matrices (then use IDRstab or BiCGSTAB(l), instead, respectively). IDR* is better than BiCGSTAB if $A+A^*$ is very indefinite.
See https://scicomp.stackexchange.com/a/34521/34228 for more on choosing the method.