x2 + bx + ax + ab is a quadratic and it does have only three terms. The terms ax and bx are like-terms that can be combined into (a+b)x which changes the equation into the form x2 + (a + b) x + ab. Remember, a and b are just numbers. For example let a = 1 and b = 2:
x2 + (a + b) x + ab
x2 + (1+2)x + (1)(2)
x2 + 3x + 2
The point is that the coefficient of the x term is equal to the sum of two number (a+b) while the constant term is equal to the product (ab) of the same two numbers. That fact allows you factor quadratics into (x+a)(x+b).