Start with whole numbers. Twelve tiles can be laid out as a 3-by-4 rectangle or a 2-by-6 rectangle, and each layout is a factor pair of 12. Algebra tiles do the same for x2+5x+6: one large x-by-x square, five x-by-1 strips and six small unit squares. Fit them into a rectangle and its sides come out as x+2 and x+3. The total area is the sum; the side lengths are the factors.
Why must the two numbers multiply to 6 and add to 5? Expand (x+p)(x+q): you get x2+px+qx+pq=x2+(p+q)x+pq. The middle coefficient is the sum of p and q, and the constant is their product. So to factor x2+7x+12, go through the pairs that multiply to 12 (1 and 12, 2 and 6, 3 and 4) and find the one that adds to 7: 3 and 4.
Factoring is not the same as solving, although the two often work together. x2+7x+12=(x+3)(x+4) is true for every x; it is a change of form. Only when the expression is set equal to zero do the factors give particular answers, x=−3 and x=−4. And not every expression factors with whole numbers: for x2+x+1 no pair multiplies to 1 and adds to 1.
Think of it like this. Factoring is working backwards from a finished rectangle of tiles to its side lengths. You know the area, x2+5x+6, and you rebuild the length and width, x+3 and x+2, that produce it. The picture fails for negative numbers, which have no tile area, but the multiply-and-add rule still works.
Core idea. Factoring intuition asks 'what times what produces this?' so a sum reappears as a product.