Everything that everyone else here has said is correct. I can only add the following bits:
When you uninstall a Mac App Store app, that does remove all of the app components. It does not remove the app data. That's a good thing. In many cases, people have a mistaken belief that they can fix some problem by uninstalling an app and reinstalling it. They may not actually want to remove the app. They often intend to reinstall and hope to continue using the app. For that reason, the data shouldn't automatically be deleted.
Unfortunately, internal app corruption is often the explanation for app problems. So that data that isn't automatically removed may be what needs to be removed. 😄 Luckily, it's well-hidden deep inside a Library folder.
Also, never use any kind of "app cleaner" or "app zapper" to uninstall apps. These apps can't possibly work on a modern version of macOS. I don't care what you hear on the internet. Modern apps can include system extensions that only the app itself, or you, can remove. A 3rd party app cannot remove them. However, in macOS Sequoia, Apple has finally provided an easy way to manually uninstall system extensions when these "app zappers" have left them running out of control.