Bit depth: In an analog signal, the voltage can take any value within a given range, so every tiny little change in voltage is preserved. In a digital signal, the voltage can only take predefined steps, so any information between those steps is lost. Bit depth is the size of those steps, and so how much information is kept. A 16-bit signal has 65536 (2^16) different values that the signal can be, 24-bit has 16777216 (2^24). Increasing the bit depth means that smaller variations in the signal are recorded and less information is thrown away. Eventually you reach a point where nobody will be able to tell the difference between the original signal and a digital copy.
Sampling rate: A digital signal isn't actually a continuous recording, but is broken up into time slots, called samples. Essentially the analog voltage is measured to make one sample, then some time passes, then the voltage is measured again for the next sample, and so on. Anything that happens between these samples is lost, so fast-changing signals (high frequencies) can't be recorded properly. The higher the sampling rate, the less the time in between these samples, and so the faster the information that can be recorded. There's some maths that says the maximum frequency that can be recorded is half the sampling rate, so for a 38kHz sampling rate signals faster than 19kHz can't be recorded properly. For a 44kHz signal nothing faster than 22kHz can be recorded. Too low a sampling rate cuts out high pitches, which makes the sound 'muddy' or boomy.
Compression: The whole point in compression is to make the files smaller, and there's two ways to do this. The first is lossless compression (like FLAC), which is the better type as it doesn't change the sound. Lossless compression just uses clever maths to make files smaller without changing their content. After decompression, the signal from a FLAC file is
exactly the same as the signal before compression - nothing is changed (so long as everything is working properly of course). On the other hand, lossy compression (e.g. MP3, WMA etc) works by discarding some information to make the file smaller. The idea is that the information discarded is stuff that you would never be able to hear anyway. The argument against it says that you actually can hear that information given the right conditions. And of course just because you can't hear something doesn't mean you can't
feel it. One thing that MP3 does is discard the really low bass. Fine with earphones as you might never be able to hear that bass, but with good enough speakers you may still be able to feel it.
BTW: Don't confuse digital compression with analogue compression, which is something completely different that makes things sound louder by decreasing the dynamic range (reducing the difference between the loudest and quietest parts).
Effects of the equipment: In theory once a signal has been converted to digital, it won't get distorted like an analog signal does. Unless you purposely change it (by compressing it or using effects), the bits that come from the ADC are exactly the same as those that get sent to the DAC (that's the point in digital). Of course nothing is perfect - a digital signal can be corrupted by hardware or software faults, by interference when it's transmitted (over wifi, digital radio etc) or even by
radiation from space crashing into the memory chips. But in general digital corruption is far more rare than analog distortion and is less of a problem. But a digital signal still has to be converted to (and from) an analog signal, so you still get analog distortion. The analog circuits in a DAC will cause some distortion when you play a track, and the ADC used in the recording studio will do the same thing when the song is recorded. Fortunately this distortion is very small, and in general a better DAC or ADC will have less distortion, just like a better amp should have less distortion.