Mass loss from evolved stars. VI: Mass-loss mechanisms and luminosity evolution