I read this in a math textbook, stated as obvious fact. I cannot wrap my head around why this works. I understood the division lemma, and also got the algorithm to work: but the proof of why the algorithm works, just said "because of the equation" that I put in the question.
Could you please elaborate on why it works?