"ordering" means arranging things in order by some metric.

"sorting" means assigning things into bins (which are usually ordered).

This is news to me. Source?

That's because it's not true.

https://www.merriam-webster.com/dictionary/ordering

Order - transitive verb - 1. to put in order : arrange - "The books are ordered alphabetically by author."

noun - 4. b(1) the arrangement, organization, or sequence of objects or of events - "alphabetical/chronological/historical order" "listed the items in order of importance"

https://www.merriam-webster.com/dictionary/sorting

Sort - transitive verb - 1. to put in a certain place or rank according to characteristics - "sort the mail" "sorted the winners from the losers" "sorting the data alphabetically"

noun - 5. an instance of sorting - "a numeric sort of a data file"

"The children were sorted in to two lines by gender then ordered by height"

You might substitute "sorted by height" but its certainly not a correction. While "ordered into lines" would be an error.

The sorting office for a postal service.

What do you do when you sort your washing?