When we install a package in most of Linux distributions, the package system installs other packages needed by the package that we actually want to install. If we uninstall the package, its dependencies won't be uninstalled, these unused dependencies are called orphaned packages.
How does the command work?
pacman -Qdtlist all orphaned packages
pacman -Rsnuninstall the listed packages