Here's the basics of it.
When a sound file is on your computer, it exists as computer data--fundamentally, a series of 1s and 0s. It exists in discrete steps. However, sound is a continuous spectrum, so you need something that will convert from digital (discrete) form to analog (continuous) form. That is what a Digital Analog Converter, or DAC, does.
An amplifier takes an existing analog signal (which is received from the DAC) and boosts it's strength. The reason why you need one is that the signal outputted from the DAC is not strong enough to produce sound at an appreciable level on many mid-to-high end headphones.
Both of these things require interactions with easily disrupted electronics, so if you put these inside the case, next to powerful electrical signals, the quality of the sound will suffer. That is why it is better to use an external DAC/amp than a sound card.