Why does factoring eliminate a hole in the limit?

I understand that to evaluate a limit that has a zero (“hole”) in the denominator we have to factor and cancel terms, and that the original limit is equal to the new and simplified limit. I understand how to do this procedurally, but I’d like to know why this works. I’ve only been told the methodology of expanding the $x^2-25$ into $(x-5)(x+5)$, but I don’t just want to understand the methodology which my teacher tells me to “just memorize”, I really want to know what’s going on. I’ve read about factoring in abstract algebra, and about irreducible polynomials (just an example…), and I’d like to get a bigger picture of the abstract algebra in order to see why we factor the limit and why the simplified is equal to the original if it’s missing the $(x-5)$, which has been cancelled. I don’t want to just memorize things, I would really like to understand, but I’ve been told that this is “just how we do it” and that I should “practice to just memorize the procedure.”
I really want to understand this in abstract algebra terms, please elaborate. Thank you very much.

we must assume $\,f\,$ is defined in some neighborhood of $\,x_0\,$ except , perhaps, on $\,x_0\,$ itself, and from here that in the process of taking the limit we have the right and the duty to assume $\,x\,$ approaches $\,x_0\,$ in any possible way but it is never equal to it.
Thus, and since in our case we always have $\,x\ne x_0=5\,$ during the limit process , we can algebraically cancel for the whole process.
The above process shows that the original function behaves exactly as the straight line $\,y=x+5\,$ except at the point $\,x=5\,$ , where there exists “a hole”, as you mention.