Gemara: Why do the goats walk at the front of the flock and are then followed by the sheep? Rav Yehuda answered: It is like the normal pattern in the world: first come the darker matters (most goats have black hair), which is followed by the lighter matters (most sheep are white haired).
Ein Ayah: The life of a shepherd brings one to healthy intellectual contemplation, in which one looks inward, and in a real, not artificial, manner. A shepherd’s life contains a lot of partnership with nature. It also does not include the type of back-breaking toil of working the land, which connects one more strongly to the material element of agriculture. That is the reason that our forefathers, who were mankind’s greatest thinkers, were shepherds.
The path of elevating one’s thought process always starts with unclear ideas. Out of their foggy characteristics comes only a great cloud of imagination. However, within the "cloud," there are great treasures, which become ever clearer, bringing light from within the darkness.
The standard status of the animals of a flock follows the pattern of human thought. If not for our ancestral shepherds, we would not have any clear thoughts. If not for the foggy thoughts, which always fill the human mind in the beginning, we would not be able to reach the eventual light that comes. Rather, first comes the set of hurried thought, which is represented by the dark-haired goats, which run forward in disarray. They precede the "orderly" group of white sheep, which represent the light.
This is the model that the shepherd sees in the flock, to which his life is dedicated. First he sees the unclear part of his group of thoughts, followed later by the discarding of the dark ideas, as from them the clear ideas emerge. This is the only way to get to more logical ideas, which become the basis for all elements of his moral life. This is the natural life. One should never give up on the life of imagination that rules over us because the light shines through it.