The fundamental mechanism of electrosorption of ions developing a double layer inside nanopores was studied via a combination of experimental and theoretical studies. A novel graphitized-carbon monolithic material has proven to be a good electrical double-layer capacitor that can be applied in the separation of ions from aqueous solutions. An extended electrical double-layer model indicated that the pore size distribution plays a key role in determining the double-layer capacitance in an electrosorption process. Because of the occurrence of double-layer overlapping in narrow pores, mesopores and micropores make significantly different contributions to the double-layer capacitance. Mesopores show good electrochemical accessibility. Micropores present a slow mass transfer of ions and a considerable loss of double-layer capacitance, associated with a shallow potential distribution inside pores. The formation of the diffuse layer inside the micropores determines the magnitude of the double-layer capacitance at low electrolyte concentrations and at conditions close to the point of zero charge of the material. The effect of the double-layer overlapping on the electrosorption capacitance can be reduced by increasing the pore size, electrolyte concentration, and applied potential. The results are relevant to water deionization.