Suppose you do bad in undergraduate school in say computer science. But you do very well in a masters program in computer science. If you want to apply to a PhD program in computer science, will the masters degree grades offset the undergraduate degree grades?
I was in exactly the situation you describe 20+ years ago. My undergrad GPA was horrible (even restricted to computer science classes); my MS GPA was near-perfect; I got into Berkeley as a PhD student. But I don't think the improvement in my grades was as important as the improvement in my letters. My undergrad letters said "He's smart but lazy", which is the kiss of death. My MS letters were much more positive. Also, when I applied to Berkeley, I had some research results in submission, so my positive letters had some substance to draw on.
Also, I got very, very, very lucky.
Now, as a faculty member who reviews PhD applications, I would certainly look at the improvement in grades as a good sign. But as I've mentioned elsewhere, above a certain threshold of "good enough", grades don't matter. Especially since you're applying with a master's degree, your demonstrated research ability is much more important.
In general, recent performance will tend to outweigh prior performance. I will look at a student with a graduate 4.0 and an undergraduate 3.2 much more favorably than the converse (unless there are obvious extenuating circumstances, such as a large jump in the quality of the graduate program compared to the undergraduate).
The source of the GPA drop is also important. A bad freshman year is almost certainly ignorable. A bad senior year is a red flag. Similarly, I will give much less weight to grades in "general education" classes, as I'm not hiring them based on their ability to analyze Shakespeare or Milton. Important classes for the major, though, can be deadly even if they are in the undergraduate years.