Ranks and Files

From Ross Honsberger via Martin Gardner: Deal cards into any rectangular array:

2012-01-26-ranks-and-files-1

Put each row into numerical order:

ranks and files 2

Now put each column into numerical order:

ranks and files 3

Surprisingly, that last step hasn’t disturbed the preceding one — the rows are still in order. Why?