Four porous carbon samples with very similar porosities but visible differences in their surface chemistry are investigated as supercapacitor electrodes in 1 M H2SO4 and 3 M NaCl. The key objective is to monitor the changes to the oxygen- and nitrogen-containing functionalities in oxygen- and nitrogen+oxygen-rich carbons upon a three-electrode test and the effect of these changes on the energy storage capacity in a real two-electrode supercapacitor setup. The carbon samples are thoroughly characterized by nitrogen sorption measurements, Raman spectroscopy, potentiometric titrations, elemental analysis, and synchrotron XPS. The findings presented in this work imply that the pretreatment of the oxygen- and nitrogen+oxygen-rich carbons under the conditions of the three-electrode test in an acidic electrolyte are beneficial to the overall energy storage capacity as the pores become more accessible to the electrolyte ions and the contribution of pseudocapacitive oxygen-containing groups increases in the oxygen-rich carbons, whereas favorable changes to the electronic structure take place in the nitrogen+oxygen-rich carbons. Thus, the total capacitance increases as a result of the improved double-layer capacitance as well as pseudocapacitance. Greater capacitance after the three-electrode test is also measured in a neutral electrolyte for both sets of samples, which is a result of improved double-layer capacitance upon the removal of some oxygen-containing functional groups that leads to better accessibility of the pores.