Flat connections and resonance varieties: From rank one to higher ranks