Understanding the steps in factoring $x^2+5xy+4y^2+5x+23y-6$ I understand the first two steps in factoring this expression, but the third step is unclear to me:
\begin{align}x^2+5xy+4y^2+5x+23y-6 &= x^2+(5y+5)x+4y^2+23y-6 \\
&= x^2+(5y+5)x+(4y-1)(y+6) \\
&= (x+(4y-1))(x+(y+6)) \\
&= (x+4y-1)(x+y+6).\end{align}
Why does the $5y+5$ disappear? 
How can I learn to see such patterns and come up with this myself? I see that $5y +5 = (4y -1) + (y+6)$. Does this observation help me in this case? Usually when factoring by grouping the goal is to get one factor multiple times and then turn addition into multiplication.
In the same way, I don't understand the second step in here:
\begin{align}(x^2-5x)^2-18x^2+90x-144 &= (x^2-5x)^2-18(x^2-5x)-144 \\
&= (x^2-5x+6)(x^2-5x-24) \\
&= (x-2)(x-3)(x+3)(x-8) \\
&= (x-2)(x-3)(x-8)(x+3).\end{align}
I have a feeling that the same thing is happening and I don't understand why I can do that. I see that $6\times 24 = 144$, and that these constants have to be at the end of the factored terms, but how does this 'enhancing' of the content of the parenthesis work? Also, the first term was squared and then the square disappears. 

Begin with $$(x-r_1)(x-r_2)=x^2-(r_1+r_2)x+r_1r_2,\tag1$$ where LHS says that $r_1,r_2$ are the roots of a quadratic polynomial, and RHS gives the coefficients of the polynomial in terms of the roots (see also Vieta's formulae).
In your equation, the coefficient multiplying $x$ is the SUM (or better, opposite of the sum) and the last coefficient is the PRODUCT of the roots.
You already noticed that $$5y +5 = (4y -1) + (y+6),$$
or $$-(5y +5) = -(4y -1) +(- (y+6)).$$ 
Therefore, in $(1)$ is $r_1=-(4y -1)$ and $r_2=- (y+6).$
