BROADER CONTEXT The controlled mixing of the water from a river and from the sea can be used for producing electrical energy. In the two main existing technologies, namely ``pressure retarded osmosis'' and ``reverse electrodialysis'', the control of the mixing is obtained by interposing membranes which can be crossed by either the water or the ions. In the recently proposed ``capacitive mixing'' (CAPMIX) technique, the freshwater and the saltwater flow through the cell in alternating phases. The mixing is obtained by electrically storing the ions inside two electrodes during the saltwater flow and releasing them during freshwater flow. The electrodes can be either chemically inert porous materials [D. Brogioli, Phys. Rev. Lett. 103, 2009, 058501], or membrane-based ion-selective electrodes [B. B. Sales et al., Env. Sci. Techn. 44, 2010, 5661], or chemically active materials, like in batteries [F. La Mantia et al., Nano Lett. 11, 2011, 1810]. In this paper, we present the analysis of activated carbon materials produced with various methods and treatments and we show that their behavior in CAPMIX experiments can display features coming both from the electric double layer and from chemical reactions, including redox reactions and chemical adsorption. By exploiting the new information, we are able to improve the energy extraction, up to the value of 50 mW per square meter of electrode.