How can I produce an installer for a set of source codes for a specific application in Linux? Also, what are the actions happening when one installs software in Linux?
As there's more than one Linux distro, there's also more than one package management solution. I think that creating an app installer depends more on the target audience than on the target system.
For source tarballs, nothing actually. The user is left alone to compile the source archive and figure out what are the dependencies (libraries and so on) without what the application wouldn't run.
For DEB and RPM (and other package management tools) the process of figuring out what dependencies are needed and the installation operation, is managed entirely by the package management tool(a connection to the Internet is needed to download the dependencies). The package management tool is responsible for registering the just installed app and all its dependencies in a local registry system so it wouldn't be necessary to install them once more for future needs.
DEB: a Debian package file. apt is Debian's package management tool.
RPM: RedHat Package Manager file. The same name goes for the package management tool.
Some commercial software or games sometimes uses Nixstaller:
Using Nixstaller we can create installers that works on most modern distributions, can install app locally or in system and looks like Windows installers ;).
But the best solution is to create native packages for each distribution so it could be managed via system package manager. For more details information about this you need to write more details about what you want to accomplish.
Prepare a makefile and make a tarball with just the source code and let every user compile it as they seem fit, and/or build an RPM package (or a .deb or something else, RPM packages are supposed to be standard).