Chainline is determined by the dimensional relationships between the frame, cassette, and chainrings.
Incorrect chainline can cause poor shifting, excessive friction and wear, and unintended shifting. Incorrect chainring spacing can affect chainline.