During the installation of Woody, it uses a program called 'Tasksel' where you select basic things that will be installed on your system, such as the Desktop Manager, Games, Development Environment, etc.
Then it goes into a more advanced package manager called 'dselect' where you choose what individual packages you want installed on your system.
I believe both those programs resolve all dependancies. Those programs are used in Woody; I don't know if it is the same for Sarge.
Once your system is installed you would use the command 'apt-get' to install programs, which also resolves dependancies for you.