Mechanisms underlying state-dependent modulation of cortical activity