There is the environment variable $XDG_DATA_DIRS.
Your .desktop files are in one of the directories listed in this variable (in a sub-directory applications).
In case of an applicaton installed as Flatpak it is most likely /var/lib/flatpak/exports/share/applications/. The line starting with Exec= in the .desktop file specifies what exactly is being run when starting the application.
Troubleshooting tip:
If you want to change something in the .desktop file make a copy to ${HOME}/.local/share/applications/. This will overrule the original package .desktop file.
If your application is crashing you might also find a report about it in the Problem Reporting application (CLI: gnome-abrt or sudo abrt-cli list).