To give a somewhat practical example, let’s consider the following iterative sequence:
$$ x_{i+1} = \frac{A x_i}{\left |A x_i \right|},$$
Where the $x_i$ are vectors and $A$ is a quadratic matrix with a matching dimension. The first vector $x_1$ shall be random¹.
When $i$ is increased, $x_i$ will more and more be aligned to an eigenvector corresponding to the largest eigenvalue of $A$ and quickly become such an eigenvector for all practical purposes. So we can use this sequence to get a numerical approximation for the largest eigenvalue of $A$ and a corresponding eigenvector (of length 1). This approach is actually used for this purpose.
Now, if we want to obtain the second largest eigenvalue of $A$ (and the corresponding eigenvector) in a similar way, we have to remove the influence of the first eigenvalue, as it would inevitably dominate our sequence otherwise. Hence we have to work in a subspace that is orthogonal to the eigenvector for the largest eigenvalue. Gram–Schmidt orthonormalisation provides a way to do this: We start with two random vectors $x_0$ and $y_0$ and then we do a Gram–Schmidt after every step:
$$\begin{align}
x_{i+1} &= \frac{A x_i}{\left |A x_i \right|},\\
y_{i+1} &= \frac{A y_i - \left \langle A y_i, x_{i+1} \right \rangle}{\left | A y_i - \left \langle A y_i, x_{i+1} \right \rangle \right |}
\end{align}
$$
Due to this, $x_i$ will align with the first eigenvector and $y_i$ will align with the second one. We can extend this scheme to further eigenvectors if we like.
The crucial feature of the Gram–Schmidt process that we exploit here is that the first $k$ vectors of its result span the same subspace as the first $k$ vectors of its input for any $k$. A consequence of this is that the $k$th output vector is orthogonal to all previous output vectors. Obviously, this would not work with any basis.
Now in many cases, you can determine the first eigenvectors more easily, but there are analogous problems, where you need to go the way described above. For example, it is used for numerical calculation of Lyapunov exponents, where $A$, $x$, and $y$ are subject to a complex temporal evolution.
¹ and thus we can assume that it is not orthogonal to any eigenvector of $A$