Difference density maps are usually calculated using Fourier coefficients which are the differences between the observed structure factor amplitudes from the X-ray diffraction experiment and the calculated structure factor amplitudes from the current model, using the phase from the model for both terms (since no phases are available for the observed data).
Density maps that show variations in structure are created by comparing actual X-ray diffraction data with predicted structures. The phases of the model are used to calculate these differences.