The median is the salary where half of the people earn more and half earn less.
The average is the number obtained by adding all the salaries and dividing it by the number of them.
Both measures are helpful indicators, but the median is considered more accurate to represent the typical salary, as it is not affected by extreme salaries, that can disproportionately affect the calculation of the average.