Think about simple linear regression (OLS) in statistics. In this case, we want to model data $y$ in terms of $x$, such that $$y = \alpha + \beta x + \epsilon.$$

If $y$ is your $n \times 1$ vector of data, then you are projecting it onto two vectors:

An $n \times 1$ vector of one's.

An $n \times 1$ vector of the independent variable $x$.

Bringing these two vectors together as columns of a $n \times 2$ matrix $X$, we can then write the OLS esitmate of $(\alpha, \beta)$ as a parameter vector $\hat{\beta} = (XX')^{-1}X'y$, such that $$E[y] = X\hat{\beta},$$ and the projection matrix is $P = X(XX')^{-1}X',$ thus the expectation is really $$E[y] = Py,$$ or the projection of $y$ onto $x$ and a scalar dimension.