In biochemistry, there are 2 fundamental ways to provide energy (make ATP)
1) substrate level phosphorylation (this is what happens in glycolysis, cause your directly sticking a phosphate on ADP to make ATP)
2) Oxidative phosphorylation (the thing in question here). This is how ATP is produced in the Electron Trans chain. It has to do with the creation of a proton motive force. Like Frederico Albin said, CO2 release has NOTHING to do with oxidative phosphorylation, cause the release of CO2 is another process (krebs cycle)