Why is the median filter called 'edge-preserving'?
Non-linearity

A linear filter is mathematically described by the convolution sum (for discrete signals) and the convolution integral for continuous signals. The median cannot be found using a linear function except in the trivial case where you have a discrete filter of size 1, which is why the median filter is non-linear.

Edge Preserving Properties.


  Median filtering is one kind of smoothing technique, as is linear
  Gaussian filtering. All smoothing techniques are effective at removing
  noise in smooth patches or smooth regions of a signal, but adversely
  affect edges. Often though, at the same time as reducing the noise in
  a signal, it is important to preserve the edges. Edges are of critical
  importance to the visual appearance of images, for example. For small
  to moderate levels of (Gaussian) noise, the median filter is
  demonstrably better than Gaussian blur at removing noise whilst
  preserving edges for a given, fixed window size. However, its
  performance is not that much better than Gaussian blur for high levels
  of noise, whereas, for speckle noise and salt and pepper noise
  (impulsive noise), it is particularly effective. Because of this,
  median filtering is very widely used in digital image processing.


Source: Wikipedia