It will not automatically remove dependencies that were installed along with a package when that package is removed. I'm guessing this is due to some historical ideology about how `apt-get` was intended to function. I just typically run `apt remove foobar && apt -y autoremove`.
There is also nala, which _does_ automatically remove dependencies when you remove a package: https://github.com/volitank/nala