Why does removal of a tooth eliminate infection beyond the gum line?

Hello all,

If I have an infection above/below my tooth that has already been root canal’d, why does removing the tooth kill the infection that is in my gum?

When I asked my dentist, I was told that my body would take care of it. But why can’t my body take care of it before the tooth is removed?

What makes the absence of the tooth a better environment for my body to fight off the infection 🤔