When we multiply them, we distribute each term in the first polynomial to each term in the second polynomial, like so:
(x+1)(x+2)
=x(x+2) + 1(x+2)
=x2 + 2x + x + 2
=x2 + 3x + 2.