Ionic-liquid gates have a high carrier density due to their atomically thin electric double layer (EDL) and extremely large geometrical capacitance C-g. However, a high carrier density in graphene has not been achieved even with ionic-liquid gates because the EDL capacitance C-EDL between the ionic liquid and graphene involves the series connection of C-g and the quantum capacitance C-q, which is proportional to the density of states. We investigated the variables that determine C-EDL at the molecular level by varying the number of graphene layers n and thereby optimising C-q. The C-EDL value is governed by C-q at n, 4, and by C-g at n > 4. This transition with n indicates a composite nature for C-EDL. 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.