How does an equalizer prevent a sample and hold effect?
Equalizers do not prevent the sample and hold effect, though if you are talking about compensation filters, see the edit below.

There are two types of reconstruction filters (also known as low-pass filters): analog and digital.  An analog low-pass filter can smooth out the output of a DAC.  A digital low-pass filter cannot, since it comes before the DAC.  What it can do is reduce the effect of the sample and hold by increasing the sample rate (assuming it is an interpolation filter) and then getting rid of the aliases via the low-pass filtering.  The effect of the sample and hold is reduced due to the increased sample rate.

EDIT: As Robert points out, the frequency droop that happens as a result of the zero-order hold can be partially compensated for with digital filters whose frequency domain gain is the inverse of the zero-order hold effect.  While this will not eliminate the sample and hold effect, it will mitigate it.