[guided]Why is an $R$-algebra homomorphism determined by the images of the generators? The key point is that $R[T_1, \ldots, T_n]$ is generated as an $R$-algebra by $T_1, \ldots, T_n$. Every element $f \in R[T_1, \ldots, T_n]$ is a finite $R$-linear combination of monomials $T_1^{\alpha_1} \cdots T_n^{\alpha_n}$:
\begin{align*}
f = \sum_{\alpha} r_\alpha \, T_1^{\alpha_1} \cdots T_n^{\alpha_n},
\end{align*}
where the sum ranges over finitely many multi-indices $\alpha = (\alpha_1, \ldots, \alpha_n) \in \mathbb{N}_0^n$ and $r_\alpha \in R$.
Now let $\varphi, \psi: R[T_1, \ldots, T_n] \to A$ be two $R$-algebra homomorphisms with $\varphi(T_i) = \psi(T_i) = a_i$ for all $i$. An $R$-algebra homomorphism must satisfy three properties: it preserves addition, it preserves multiplication, and it fixes every element of $R$ (i.e., $\varphi(r \cdot 1) = r \cdot 1_A$ for all $r \in R$). These three properties together force:
\begin{align*}
\varphi(f) &= \varphi\Bigl(\sum_\alpha r_\alpha \, T_1^{\alpha_1} \cdots T_n^{\alpha_n}\Bigr) = \sum_\alpha r_\alpha \cdot \varphi(T_1)^{\alpha_1} \cdots \varphi(T_n)^{\alpha_n} = \sum_\alpha r_\alpha \, a_1^{\alpha_1} \cdots a_n^{\alpha_n}.
\end{align*}
The same computation gives $\psi(f) = \sum_\alpha r_\alpha \, a_1^{\alpha_1} \cdots a_n^{\alpha_n}$. Since this holds for every $f \in R[T_1, \ldots, T_n]$, we conclude $\varphi = \psi$. The essential insight is that the $R$-algebra structure leaves no freedom once the images of the generators are fixed.[/guided]