I understand how factoring a quadratic $(ax^2 + bx +c)$ with "$a$" equal to one works. If it's in the form $(x+d)(x+e)$ then "$d$" and "$e$" are the only two terms that can multiply together to yield a term with no "$x$". And when "$d$" is multiplied by the 2nd "$x$", and "$e$" is multiplied by the first "$x$" and the like terms are added together they yield "$bx$". Thus, with this information we can get the factored form.
Question: How does the "trick" that math teachers teach us to factor quadratics with "$a$" not equal to 1 work? This is the trick where we figure out what multiplies to "$ac$" and what adds to "$bx$", then rewrite the quadratic in the form $ax^2 + dx + kx + c$ and factor from there.
Note: I've been using this trick for a long time, and this isn't my first time with quadratics, but this is a question that's been bugging me for a while. I'm sorry if the answer is glaringly simple. Thanks for your help.