Why does putting linearly dependent vectors in a matrix and row reducing yield their coordinates?

Let's begin with what I suspect you already know about row reduction: an $m \times n$ matrix $A$ and its row-reduced version $R$ have the same nullspace. In other words, $$ Ax = 0 \iff Rx = 0, \quad x \in \Bbb R^n. $$ Now, let $a_1,\dots,a_n$ denote the columns of $A$. Suppose that $a_1,a_2$ are linearly independent, but $a_3 = 3a_1 - 2a_2$. What does this tell us about the columns of $R$?

Notice that this equation actually gives us a solution to the equation $Ax = 0$. In particular, $$ a_3 = 3a_1 - 2a_2 \implies 3a_1 - 2a_2 - a_3 = 0 \implies\\ \pmatrix{a_1 & a_2 & a_3 & a_4& \cdots & a_n} \pmatrix{3\\-2\\-1\\0\\ \vdots \\ 0} = 0. $$ That is, $x = (3,-2,-1,0,\dots,0)$ is an element of the nullspace of $A$. The same must hold for $R$.

On the other hand, note that because $a_1,a_2$ are linearly independent, each of these becomes a pivot column in the RREF matrix $R$ (more generally, $a_k$ becomes a pivot column iff $a_k$ is outside of the span of $a_1,\dots,a_{k-1}$). With that, we know that $R$ has the form $$ R = \pmatrix{r_1 & r_2 & r_3 & r_4 & \cdots & r_n} = \pmatrix{1 & 0 & ? & \cdots\\ 0 & 1 & ? & \cdots\\ 0 & 0 & ? & \cdots \\ \vdots & \vdots & \vdots & \cdots}. $$ From the fact that $x = (3,-2,-1,0,\dots,0)$ is in the nullspace of $R$, we have $$ Rx = 0 \implies 3r_1 - 2r_2 - r_3 = 0 \implies r_3 = 3r_1 - 2r_2. $$ So, we can conclude that $r_3 = (3,-2,0,\dots,0)$.


Starting with the matrix $A$ as follows

$A = [ v_1 , v_2, ..., v_m ] $

Reduce it to reduced-row echelon form $\widetilde{A} $, this is equivalent to premultiplying $A$ with the matrix $E$

$ \widetilde{A} = E A = [E v_1, Ev_2, ..., E v_m] $

where $E v_k$ is either an elementary unit vector $e_i$ or a linear combination of the other $e_i$'s. Thus if

$ v_k = \displaystyle \sum_{i=1, i \ne k}^m \alpha_i v_i $

Then

$ E v_k = \displaystyle \sum_{i=1, i \ne k}^m \alpha_i E v_i $

Thus we can identify the vectors that are linearly independent, by identifying those columns that reduce to different $e_i$'s, while the others are linearly dependent on them. And the coefficients of this dependency are the entries in the reduced row echelon form for that column.