Sf2 soundfonts are files edited by Polyphone. Each sf2 file comprises one or more musical virtual instruments, made of audio samples and a lot of parameters. Parameters define how the samples should be played throughout the keyboard, possibly modulated by predefined signals (modulators). Sf2 files are build according to a 3-level structure:
Soundfonts are used by software synthesizers using wavetables, such as fluidsynth, these synthesizers being driven by MIDI signals. Sound production implies a sample reading taking into account every parameter entered in the soundfont.
For more information on the format, the specifications are available here.