The trapezius muscle is huge and has fibers that run in multiple directions which gives it the ability to do lots of different things. As a whole, the trapezius originates at the middle portion of the base of the skull (external occipital protuberance and the medial portion of the superior nuchal line or you can just say middle of base of skull), it latches on to the big thick neck ligament and then grabs on to the spinous processes of C7-T12. It inserts itself on the lateral third of the clavicle, the acromion and the spine of the scapula.
Probably everyone knows where their upper traps are because nearly everyone complains about how tight they are. What tends to happen is the upper traps get overdeveloped while the middle and lower traps get weak. Learning how to use the middle and lower traps to retract and depress the scapulae rather than trying to force them down with the the upper traps (which don’t have the pulling capacity to do that at all) can be helpful in reducing shoulder and neck tension/pain and headaches.
The upper fibers of the trapezius muscle are very involved in head and neck movement. The traps laterally flex the head and neck, rotate (turn) the head to the opposite side (so if you look to the right, your left upper trap is contracting) and when both the left and right upper trapezius muscles fire together, they extend the head and neck. In addition to that they also elevate the scapula and they upwardly rotate it as well.
Moving down to the middle fibers... it makes sense that they retract and stabilize the scapula because the origin is on the spine. If the middle fibers of the trapezius which are perpendicular to the spine contract, the origin will pull the insertion toward it which draws the shoulder blades in toward the spine. Think about someone placing their fingers between your shoulder blades and then you gently pinching them by drawing the shoulder blades together. This activates the middle fibers of trapezius.
If you look at the fibers of the lower trapezius you can see that they run in a more downward direction. This gives them the leverage they need to depress the scapula or draw the shoulder blades down the back.
Try this: Place your right hand on your left upper trap and see how it feels. Then relax your arms and shake them off a little bit. From there, gently gather the shoulder blades together, and then imagine sliding just the bottom tips of the shoulder blades down and into your back pockets. Maintain that and take the right hand to the left upper trap again and see how it feels softer with the support coming from the middle and lower fibers below.