Sorting cattle is one of the real arts of animal husbandry. Sorting can be done for many reasons and by many methods.
Often the goal of sorting a group of cattle is to put like kinds together. For instance, one might sort cows from calves, steers from heifers, etc. Sale barns typically sort the load of calves that you bring them so that they will bring the most money. If they can sort your calves into groups of 10 or more head that all match in terms of sex, size and type, then those calves will get a premium. If nothing matches anything else, they have to sort them into singles so that each calf can be presented to the buyer who wants that type.
If you intend to sell a group of feeder calves "in the country," you will likely want to sort that group so that the calves you sell fit your description, and you can keep the calves that are too light for the sale group. In another scenario, you may want to sort thin cows from fatter cows so that you can feed the two groups differently. While rarely needed in a commercial enterprise, cattle in research projects are often sorted randomly into groups so that each group is as much like the other groups as possible. This helps to avoid any bias in the results. In any case, you can see that sorting is a skill that allows for good management decisions to be implemented.
Sorting cattle can be accomplished successfully in many ways. The key is controlling the animals so the behavior of individuals can be managed at will. This is a little different concept than moving herds of cattle around, which is sort of controlling the behavior of the herd as a group. One of the best ways to sort cattle is to put them in an alley about 12 feet wide and sort as they go past the sorter down the alley. The sorter can use a sorting stick (my favorite), a "rattle paddle," an empty sack, a hat or nothing at all to help sort the cattle. If the cattle are gentle, the facilities are in good shape and the sorter is skilled (admittedly, a rare combination), sometimes very subtle movements by the sorter are all that is needed to achieve the desired effect.
Sorting can also be done on horseback (the origin of the sport of cutting) either in pens or out in the open. Dogs can help sort cattle as well, although some dogs I have seen were not very accurate in the way they sorted.