Apple created a great little network protocol system called zeroconfig, or Bonjour on Apple stuff. Basically it allows two devices to talk over a network and it'll do all the complex stuff in the background. Many wireless printers support this.
iTunes also supports this, and in the preferences on Dave's laptop will be a setting ticked to share his music.
It'll work for any computers within the local subnet: for you, that'll be just your two laptops. They don't let you copy stuff across since that would promote piracy, which they don't want to be seen to do.