In a sense, I feel like I understand every step in the following (fairly typical) calculation, but I don't understand the conclusion.
I consider a vector space spanned by two basis vectors $|\phi_A\rangle$ and $|\phi_B\rangle$. I can use this basis to decompose an arbitrary state:
$$ |\psi\rangle=\sum_{i=A,B}\langle\phi_i|\psi\rangle|\phi_i\rangle=\sum_{i=A,B}\phi_i|\phi_i\rangle, $$
where I have defined $\phi_i=\langle\phi_i|\psi\rangle$.
Now I assume that $|\psi\rangle$ is an eigenvector of the Hamiltonian, so that (invoking the resolution of the identity in the first step):
$$ \langle\phi_m|H|\psi\rangle=\sum_{i=A,B}\langle\phi_m|H|\phi_i\rangle\langle\phi_i|\psi\rangle=\sum_{i=A,B}H_{m,i}\phi_i=E\langle\phi_m|\psi\rangle=E\phi_m $$
where I have defined $H_{m,i}=\langle\phi_m|H|\phi_i\rangle$.
Equating terms we see that $\sum_{i=A,B}H_{m,i}\phi_i=E\phi_m$, which reminds us of the rule for matrix multiplication. Therefore, we represent the operator $H$ by a matrix acting on a vector which represents the state $|\psi\rangle$:
$$ \left[\begin{matrix} H_{A,A} & H_{A,B}\\ H_{B,A} & H_{B,B} \end{matrix} \right] \left[ \begin{matrix} \phi_{A}\\ \phi_{B} \end{matrix} \right]=E\left[ \begin{matrix} \phi_{A}\\ \phi_{B} \end{matrix} \right]. $$
The column vector could instead be written:
$$ |\psi\rangle=\left[\begin{matrix} \phi_{A}\\ \phi_{B} \end{matrix} \right]=\phi_A\left[\begin{matrix} 1\\ 0 \end{matrix} \right]+\phi_B\left[\begin{matrix} 0\\ 1 \end{matrix} \right] $$.
But hang on, that expansion is exactly the same as the expansion I made in the very first equation, if we make the identification:
$$ |\phi_A\rangle=\left[\begin{matrix} 1\\ 0 \end{matrix} \right];|\phi_B\rangle=\left[\begin{matrix} 0\\ 1 \end{matrix} \right]. $$
I don't understand this: I thought the basis I chose in the beginning was arbitrary, but now I seem to know what my basis vectors are. That is, they are not arbitrary at all, and I at least think I know what they are specifically.
My feeling is that I have at some point (without realizing) assumed that this is my basis. I think this was likely the step in which I assumed that $|\psi\rangle$ is an eigenvector of $H$. Is that correct?