In general terms, the ones that cause problems with the function of the spinal cord and/or nerves.
The spinal cord is the more serious. Pressure on the cord or nerves or abnormal movement (instability) that threatens them are reasons for surgery. Severe deformity can irritate them or cause severe pain or poor appearance. Severe pain may be a reason for invasive treatment, but not in all cases.