People love to debate whether CO2 leads or lags temperature, based on ice core graphs. The whole discussion is a farce. You can make CO2 appear to lead or lag by how you position the two graphs on the Y-axis.
CO2 appears to lag.
Same graph with the Y-axis shifted. Now CO2 appears to lead.
CO2 changes as a response to ocean temperature. Warmer water (and beer) can hold less CO2, so it outgases CO2 to the atmosphere. Cold water holds more CO2, and removes it from the atmosphere. This is one of the first things geology students learn.