Ionic-liquid gates have a high carrier density due to their atomically thin electric double layer (EDL) and extremely large geometrical capacitance Cg. However, a high carrier density in graphene has not been achieved even with ionic-liquid gates because the EDL capacitance CEDL between the ionic liquid and graphene involves the series connection of Cg and the quantum capacitance Cq, which is proportional to the density of states. We investigated the variables that determine CEDL at the molecular level by varying the number of graphene layers n and thereby optimising Cq. The CEDL value is governed by Cq at n < 4, and by Cg at n > 4. This transition with n indicates a composite nature for CEDL. Our finding clarifies a universal principle that determines capacitance on a microscopic scale, and provides nanotechnological perspectives on charge accumulation and energy storage using an ultimately thin capacitor.