What projection means
The projection of onto keeps only the part of that points in the same direction as .
The dot product measures alignment, and dividing by turns that alignment into the correct scale factor for vector .
The leftover error is the perpendicular part that cannot sit on vector B.