Apt maintains a local database of all available deb package from all currently-known sources. "Available" means that it includes packages that you don't currently have installed as well as the packages that you DO currently have installed.
apt-cache
searches the database
apt update
refreshes the database from those sources
apt list libreoffice-writer
or apt list libreoffice*
will specify which packages in the output are installed.
Now let's look at files and directories that remain after a --purge.
Directories may remain if they are not empty after apt is done removing files. Some other package (or the admin) may be using the directory, too.
Apt will NEVER remove any file located under your /home directory. (The manpage is very clear about that)
A word about using wildcards with apt: Many users are surprised when wildcards cause extra packages to be marked for action, and when packages they expected to be marked aren't.
There could be lots of possible reasons why you get an action different than you expect: Dependencies, unexpected names, misspellings, wrong wildcard, etc.
There are two schools of thought on safe, effective usage of wildcards with apt:
Use apt's --simulate
to test the action first. Review your output and find the unexpected BEFORE doing it for real.
Avoid using wildcards at all. Use apt's tools to KNOW the correct packages you want to act upon. Then list those packages.