The medial cord is medial to the second part of the axillary artery and is the continuation of the anterior division of the inferior trunk—it contains contributions from C8 and T1.
The posterior cord occurs posterior to the second part of the axillary artery and originates as the union of all three posterior divisions—it contains contributions from all roots of the brachial plexus (C5 to T1).