If you have any Flatpak programs installed on your Linux desktop, you will notice that
/var/lib/flatpak takes up several gigabytes. This is because, as a concept, a Flatpak package contains all possible libraries that the program could ever load.
However, when you uninstall the program, these packages remain on the startup disk because you may need them in the future. In my case, after installing a dozen very simple programs the directory was over 8 gigs…
To ask the system to clean up unused packages, the command is:
flatpak uninstall --unused