In algebra, we deal with real numbers that can be written as product of factors.
For example 6 can be factored as 2*3, 16 can be factored as 2*8.
In the similar manner, factoring of polynomial can also possible.

A polynomial can be defined as an expression involving variables with positive integer power connected by arithmetic operation
When any polynomial is factored, the process is to find simpler polynomials which when multiplied together gives the polynomial that we  started with. 
When a polynomial is factored, the main process is to break it down into polynomials that have integer coefficients and constants.
Factoring can only be possible when there are two or more terms are present in the polynomial. So factoring is not possible if we are dealing with a monomial, as factoring is the process of writing a polynomial, as a product of two or more polynomial.

The simplest way of factoring is to factor out the common term from all terms of a binomial. But in some case, there may be four terms, where there is no common term for all of them. In such situation, the whole polynomial is split into two pairs and then factor them separately.
So this type of factoring the polynomial is also called factoring in pairs.

For example factor $xy+2x +5y+10$
It can be clearly seen that all of the four terms doesn’t have any term common together.
So lets try to factor them in pairs.
Here take first two terms together and then the last two terms together.
In the first two terms, $xy+2x$,
It can be seen that both has $x$ common,
So, $xy+2x= x(y+2) $
In the second set of pairs, $5y+10$
Here the common term is $5$.
So, $5y+10=5(y+2) $
$xy+2x +5y+10=x(y+2) +5(y+2) $
So here in the resultant polynomial there are two factors $ x(y+2) $ and $5(y+2) $
It can be seen that both has (y+2) as common factor
So, $ x(y+2) +5(y+2) = (x+5) (y+2) $