Four terms often share nothing as a whole: 2x3+6x2+5x+15 has no factor common to all four. Split it into two pairs, though, and each pair has its own GCF: 2x3+6x2=2x2(x+3) and 5x+15=5(x+3). Both pairs left behind the same bracket, (x+3).
Now treat that bracket as a single block. 2x2 blocks plus 5 blocks make (2x2+5) blocks, so 2x2(x+3)+5(x+3)=(2x2+5)(x+3). It is the same move as 5y+3y=(5+3)y, with (x+3) playing the part of y.
Grouping also finishes trinomials with a=1. For 6x2+7x+2, the AC method finds 3 and 4 (product 6⋅2=12, sum 7), so split the middle term: 6x2+3x+4x+2. Group: 3x(2x+1)+2(2x+1)=(3x+2)(2x+1). The trinomial became a four-term polynomial on purpose.
Grouping is not guaranteed to work. x3+x2+x+2 gives x2(x+1)+1(x+2), and the brackets differ; other pairings fail too, because this polynomial has no factorization with integer coefficients. When every pairing leaves different brackets, the expression may simply not factor this way.
Think of it like this. Grouping is like sorting a pile of letters into two stacks and finding that both stacks are addressed to the same street: you write the street once and list the house numbers beside it. That street is the shared binomial. If the stacks show different streets, sort the pile another way; sometimes the letters have no common street at all.
Core idea. Group four terms into two pairs so a common binomial pops out and can be factored once more.