There is no simple answer to this question, but I can give you a general outline of how it works:
Most Linux software is provided by the authors (the "upstream") in source code form. This allows everyone who has a compiler for their particular platform and system configuration to download the sourcecode and compile it themselves. Unfortunately for you, many programs rely on functions provided by other programs and software libraries (dependencies).
Windows software usually comes in precompiled form. That means there's one generic executable file for all Windows computers, and the dependencies often come with it in the install package.
Linux distributions take the sourcecode, precompile it for you and offer it to you as a package, too. The package doesn't include the dependencies, but it refers to them and forces the package system to install them as well (which can sometimes lead to mess-ups which you've probably experienced yourself already).
If there is no precompiled package, you can always download the source code and compile it yourself. Most of the time, the following will work:
(sudo) make install (or sudo checkinstall)
The ./configure line sets the stage for the compilation process (and spits out errors if dependencies aren't met). The make line will execute the Makefile, a script that compiles all parts of the program.
Traditionally, you would use make install to then install the software. This usually puts the executables in /usr/local/bin.
Since you're using apt, I very much recommend getting checkinstall. You can use it in place of make install, and it will generate a .deb package for you. This makes it much easier to cleanly remove the software later on.
Note that there are a handful of other compilation sytems, for example cmake; and some software comes precompiled but unpackaged (in which case you can start it right from the unzipped folder); and some software comes as a collection of scripts you have to run yourself. Fresh code from SVN sometimes comes without configure scripts, so you have to first run the autoconf toolchain ... etc, etc ... you see there are lots of exceptions to the rule, but with a little experience you'll be able to tell what to do with most of those mysterious downloads. Configure-Make-Checkinstall is a good first start.
PS. Spend a weekend or two to learn how to program yourself, and things will become very obvious :-)
PPS. You may wonder why Linux software authors don't just provide precompiled packages instead of the sourcecode. Well, they sometimes do. But different platforms and Linux distributions all have their own package formats and file system rules, so as a developer you'd have to provide packages for every possible configuration -- which is a pain. Ubuntu packages are often the easiest to find though -- you should find out what a PPA is and how it works!