Being new to Linux, maybe this is a stupid question! I don't quite understand how this distro thing all works, is Raspbian just compiled packages with source code taken from the individual repositories of the respective packages? Are there source code changes required to make a distribution, if so is there a branch or GitHub repository for instance? And lastly how does it relate to the 'linux' here github.com/raspberrypi/linux?
Rather than a brand new OS, Raspbian is a modified version of the popular Debian
Squeeze Wheezy distro (which is currently in stable testing). It runs on a patched version of the Linux Kernel, which is what can be found on the Raspberry Pi GitHub. This version adds several Raspberry Pi optimisations to the kernel sources.
is Raspbian just compiled packages with source code taken from the individual repositories of the respective packages
The most important difference of Raspbian is that it is built with Hard Floating Point support, which drastically improves performance. Packages tend to be provided as source, and can be compiled with any compiler, in this case each package (apparently currently in the region of 35000), has had to built especially for the Raspberry Pi using a hard float compiler (and some other optimisations).
Are there source code changes required to make a distribution, if so is there a branch or GitHub repository for instance?
Are you interested in making a distribution? You could start by reading the processes that the Raspbian developers went through when starting out. Here is an interesting post on the forums that is worth reading. And then consider taking a couple of days to get to grips with a Linux From Scratch project.
Linux is technically just the kernel which is the core software that provides low-level access to the hardware - things like sending data over the network, displaying graphics, sound output, starting and stopping programs, reading and writing files and so on.
Obviously you need a lot more software than that to have something useful. You need things like a shell (Command Terminal in Windows), a GUI, programs to list and copy files, then there's all the stuff like a file manager, web browser, media players, compiler, whatever. All of that, together with the kernel is a 'distribution'. In the linux world, people tend to put everything in distributions. Like, every piece of software ever written.
It's frankly the wrong way to do it, but nobody has come up with a better way yet, and the reason is simple: different distributions are inconsistent about how things work, so often software will have to be changed a bit to work on different distros. For example, they may store configuration files in different directories, or name libraries differently, or all manner of other changes, some good, some idiotic.
One of the biggest ways distros vary is how they handle including every piece of software ever written. Obviously you can't install all that crap onto your computer - instead it is stored on some servers somewhere, and you use something called a package manager to get what you want (basically like Apple's app store but way more powerful and way less user friendly, and slightly less reliable).
The two most popular package managers are APT (Advanced Package Tool I think), which is used by the very popular distro Debian, and also Ubuntu which is derived from Debian (they share a lot of stuff), and RPM (Red Hat Package Manager one would guess), which is used by Red Hat. That is more popular in the corporate world.
So anyway, getting back to the point, Raspbian is a modified version of Debian, optimised to work on the Raspberry Pi. The optimisations are basically different compiler options so that it runs faster. Oh and it includes all the closed source drivers and things necessary for the RPi's graphics card. GPU. Whatever.
You can basically think of it as like Linux's version of Windows RT.
Hope that helped. Sorry if it was too simple!