Long-lived stars will move in and out of the spiral arms as they orbit the galaxy. Star formation occurs in the spiral arms because the gas clouds are compressed in the arms to form stars. They outline the spiral pattern the same way christmas lights around the edges of a house will outline the borders of the house at night. The O and B-type stars live for only a few million years, not long enough to move outside of a spiral arm. That is why they are found exclusively in the spiral arms.
Differential rotation provides an easy way to produce a spiral pattern in the disk.
Differential rotation is the difference in the angular speeds of different parts of the galactic disk so stars closer to the center complete a greater fraction of their orbit in a given time. But differential rotation is too efficient in making the spiral arms. After only 500 million years, the arms should be so wound up that the structure disappears. Also, the spiral pattern should occupy only a small part of the disk. The spiral arms are where the stars pile up as they orbit the center.