Recent versions of Ubuntu are shipping with Snapcraft by default, and some of the default applications run inside a snap as well. Snaps are application containers, similar to Docker, but designed for desktop applications.
Unfortunately Canonical seems to be pushing Snaps hard, and they are not always wanted. This is made worse by not providing an easy way to remove the snap functionality for Ubuntu.
The commands bellow will entirely remove snap from an Ubuntu installation.
Note: by default Firefox is installed as a snap and will be removed with the above commands. So if you want to keep Firefox installed (or any other snap program you had previously installed) you will need to re-install it using apt.
sudo apt install firefox
The above commands have been successfully tested and work on Ubuntu 20.04 and 22.04.