It seems to be mostly due to the convenience of the channel or network airing a series with a number of pre-recorded episodes or at least a batch of them. For example, when a network buys or syndicates a series that has, let's say, 10 episodes and start airing the episodes in december, if they air episodes 1 and 2 but the christmas episode of the series is the number 10, they will air the 10th episode as the 3rd one to coincide wih the holidays.
Other scenario is when something happens in the real world and the series has an episode that deals with a similar theme. Take as an example the shootings that happened in France recently. Some networks will alter the airing order of episodes in a series to avoid a similar subject to avoid the sensationalism, other may try to cash on it and air sooner an episode that dealed with something similar.
Also, a network can try to get people into watching their series and getting high ratings, airing the "best" episodes of a series first (i.e. the ones with the more action, or drama, or sex, etc.).
Then, when the series go to DVD the numbering order is usually the scripted order and not the airing one, that's why both differ.