On the Lecture 16 Part 1 of the Advanced Calculus lecture by James Cook the last line of the following definition of the metric tensor
$$\begin{align} g(x,y) &= g\left( \sum_i x^i e_i, \sum_j y^j e_j\right)\\[2ex] &= \sum_{i,j}x^i\;y^j\;g(e_i,e_j)\\[2ex] &=\left( \sum_{ij} g_{ij}\;e^i \otimes e^j \right)\;(x,y) \end{align}$$
is explained quickly and almost in passing. What is the idea behind this last step?
By the definition of the tensor product, each $e^i \otimes e^j$ is a bilinear function which acts on $(x,y)$ as $(e^i \otimes e^j)(x,y) = e^i(x) e^j(y)$. The term $e^i(x)$ is just the $i$-th coordinate of $x$ with respect to the basis $(e_i)$ - in other words, $e^i(x) = x^i$. Hence,
$$ (e^i \otimes e^j)(x,y) = e^i(x) e^j(y) = x^i y^j $$
and so
$$ \left( \sum g_{ij} e^i \otimes e^j \right)(x,y) = \sum g_{ij} (e^i \otimes e^j)(x,y) = \sum g_{ij} x^i y^j $$
and this is the same as middle expression, taking into account that $g_{ij} := g(e_i, e_j)$.