There are three of those what we call special products when it comes to factoring of quadratic equations
1. difference of squares
   e.g. (a² - b²) = (a - b)(a + b)
2. square of sum
  e.g. a² + 2ab +b² = (a + b)²
3. square of difference
 e.g. a² - 2ab +b² = (a - b)²

NOTICE that in 1. the factors are positive and negative of a and b since in the expanded form, there's no second term. the negative and positive signs make it possible to have the middle term eliminated during expansion of term.
In 2. note that in dealing with square of sum, the middle term is positive such that when you divide it's coefficient regardless of 'a' by '2', you'll be able to have the third term by squaring it.
in 3. it's more like that of 2. only the middle term is in negative sign since the factors involves negative second terms.. notice that when the second term of the factor is squared, you will still get a positive third term