The trapezius muscle is a large superficial back muscle that resembles a trapezoid. It extends from the external protuberance of the occipital bone to the lower thoracic vertebrae and laterally to the spine of the scapula. The trapezius has upper, middle, and lower groups of fibers.
The ventral rami of C3, C4 innervates the sensory function of the trapezius. Cranial nerve XI innervates the motor function of the trapezius.
The function of the trapezius is to stabilize and move the scapula. The upper fibers can elevate and upwardly rotate the scapula and extend the neck. The middle fibers adduct (retract) the scapula. The lower fibers depress and aid the upper fibers in upwardly rotating the scapula. These motions allow for the scapula to rotate against the levator scapulae and the rhomboid muscles. This rotation is important, in conjunction with the deltoid muscle, for throwing objects.
Unequal development of the three trapezius fibers causes muscle imbalances and posture disturbance can occur. Injury to cranial nerve XI can result in denervation and subsequent loss of motor function of the trapezius, resulting in muscle wasting. Cranial nerve XI can be examined during a clinical examination by asking the patient to shrug their shoulders passively, then actively against the examiner's resistance.
Structure and Function
The trapezius is a muscle made up of particularly long muscle fibers that span a large width of the upper back. Functionally, this allows the trapezius to assist in mainly postural attributes, allowing and supporting the spinal column to remain erect when the person is standing. The trapezius is one of the broadest and most superficial (closest to the skin) muscles of the upper back and trunk, meaning upon dissection of a cadaver it is often used as a landmark because it is encountered first. This muscle is triangular, broad, and thin and covers the upper back of the shoulders and neck. Its attachment points consist of the spinous process of C7-T12 of the spine, ligamentum nuchae, scapulae, clavicles, and ribs. The trapezius muscle is mainly postural but is also used for active movements such as side bending and turning the head, elevating and depressing the shoulders, and internally rotating the arm. The trapezius elevates, depresses, and retracts the scapula. The descending muscle fibers of the trapezius muscle internally rotate the arms. The transverse muscle fibers retract the scapulae, and the ascending muscle fibers medially rotate the scapulae.
The entire musculature of the human body, both striated and smooth muscle, arises from the mesoderm. A few exceptions arise from the ectoderm. The trapezius and sternocleidomastoideus muscle originates in the lateral occipital area and initially forms as a singular mass. At this very early period it is innervated by the nervus accessorius (CN XI in the adult form), and as the muscle mass moves into its adult position, it extends and moves caudally, carrying the nerve with it. The trapezius and the sternocleidomastoideus arise from a single mass and then split around the 20th week of development. It is not unusual for the muscle to receive secondary new nerves while retaining its original nerve CN XI and later receiving branches from the cervical plexus. 
Blood Supply and Lymphatics
Two main variants to the vascular supply to the trapezius develop from three common sources. The most common variant involves the main supply of blood from the transverse cervical artery, with collateral supply from the dorsal scapular artery for the superior portion, and the posterior intercostal arterial branches from the deep portions. The second less common variant has more blood supply from the dorsal scapular artery. 
Motor supply of the actions of the trapezius stems from the accessory nerve, also known as CN XI. Shoulder range of motion (ROM) with cephalad motion of the shoulders, "shrugging," is a common physical exam maneuver to test CN XI.  Sensation to the trapezius muscles, including pain and proprioception or the sense of position in space, occur via the ventral rami of the third (C3) and fourth (C4) cervical nerves. One may think that since the trapezius muscle is on the back, it would be innervated by the dorsal rami; however, the trapezius is a muscle of the upper limb, leading it to be innervated by the ventral rami.
Additional muscles that assist or are assisted by the trapezius include the latissimus dorsi, rhomboids, and levator scapula. The trapezius and semispinalis capitis muscles create the main mass of muscle at the occipital region at the base of the skull.
Anatomical variants of the trapezius muscle, though statistically rare, are noteworthy and diverse. Many of these variants are developmental and related to agenesis of the trapezius, whether that be unilateral or bilateral, resulting in hypoplasia or accessory lobes of muscle.  One reported case of inheritable absence of the trapezius reported the daughter of two parents with absent trapezius also having the absence of the muscle. Another phenomenon would be dysfunction or absence of the accessory nerve (CN XI), causing hypoplasia and not an actual absence of the trapezius muscle.
Surgical considerations are limited due to the sustainability of quality of life if the trapezius is injured. If dissection of the accessory nerve occurs, attempts to repair have been attempted, but success rates are in the mid-teens in percentile. Because of poor outcomes, this procedure is often forgone. One of the most common surgical interventions involving the trapezius region includes a trapezius flap for those patients who have undergone or have lateral craniofacial or lateral basilar skull defects. Flaps of the trapezius also are used for oral or pharyngeal defects. 
Trapezius hypertonicity and spasm is a common cause of tension headaches among the general population. Due to the path of the accessory nerve and occipital nerve, they can become entrapped, causing the classic ram's horn distribution of a tension headache. This headache is bilateral, throbbing, traveling from the occipital region, and wrapping around to the top of the head and forehead region. Stress, posture, and inadequate stretching before activity can exacerbate these symptoms. There are no prodromal or sensorineural exacerbations related to light or sound. Tension headaches are often treated with a suboccipital release, stretching, stress/anxiety relief, and NSAIDs. 
(Click Image to Enlarge)
Muscles connecting the upper extremity to the vertebral column, Occipital Bone, Superior Nuchal Line, Sternocleidomastoid, Ligamentum Nuchae, Splenius Capitis of Cervicis, Levator Scapula, Rhomboideus Minor and Major, Spine of Scapula, Trapezius, Deltoideus, Teres Major, Infraspinatus, Latissimus Dorsi, Serratus Posterior Inferior, Lumbar Triangle, Cres of Ilium, Sacral Vertebra
Contributed by Gray's Anatomy Plates
(Click Image to Enlarge)
Surface anatomy of the back, Trapezius, Spine of Scapula, Rhomboideus major, Teres Major, Deltoideus, Inferior Angle of Scapula, Sacrospinalis, Iliac crest, Latissimus Dorsi, Glutaeus Medius and Maximus
Contributed by Gray's Anatomy Plates
Badura M,Grzonkowska M,Baumgart M,Szpinda M, Quantitative Anatomy of the Trapezius Muscle in the Human Fetus. Advances in clinical and experimental medicine : official organ Wroclaw Medical University. 2016 Jul-Aug [PubMed PMID: 27629832]
Bae JH,Lee JS,Choi DY,Suhk J,Kim ST, Accessory nerve distribution for aesthetic botulinum toxin injections into the upper trapezius muscle: anatomical study and clinical trial : Reproducible BoNT injection sites for upper trapezius. Surgical and radiologic anatomy : SRA. 2018 Jun 26 [PubMed PMID: 29946827]
Ranade AV,Rai R,Rai AR,Dass PM,Pai MM,Vadgaonkar R, Variants of latissimus dorsi with a perspective on tendon transfer surgery: an anatomic study. Journal of shoulder and elbow surgery. 2018 Jan [PubMed PMID: 28939333]
Rodríguez-Huguet M,Gil-Salú JL,Rodríguez-Huguet P,Cabrera-Afonso JR,Lomas-Vega R, Effects of Myofascial Release on Pressure Pain Thresholds in Patients With Neck Pain: A Single-Blind Randomized Controlled Trial. American journal of physical medicine [PubMed PMID: 28678033]