With data, you can have outliers. Outliers are values that do not follow what the range or majority of the data you collected so a value of 45, 42, 45, 48, 42, 44, 88, the mean will obviously be different because the 88 is going to change the whole data. But, if you put it from least to greatest, you can see what the majority of data is, (what the middle value is) to see what is in the middle range of what you have collect- the outliers don't affect what you have. Hence, 42, 42, 44, 45, 45, 88 (it's not much data) but it can show what the majority of data is. Hope this helps :> :)
When there is an outlier in the data set, the dot plot or histogram will be skewed. In a skewed representation, the mean is pulled up or down toward the tail of the data. Therefore, skewed data affects the mean more than the median.