MOS capacitors have three layers: the bottom layer is a semiconductor substrate, the middle is an insulating layer, and the top metal layer is the gate electrode, which controls the capacitor's voltage. At zero gate voltage, no current flows, and the capacitor is uncharged. Applying a negative voltage at the gate attracts holes to the semiconductor's surface, forming an accumulation region. The device behaves as a conventional capacitor. Applying a positive voltage, holes are repelled back into the substrate, establishing a space charge region called the depletion region, which acts as another capacitance in series. With a high enough voltage, the concentration of electrons on the surface increases, forming an inversion layer and further decreasing the capacitance. This results in a sharp increase in current. Removing the voltage dissipates the accumulated charge, making the channel disappear and switching off the device. MOS capacitors are used in memory devices like DRAM, where data writing involves applying gate voltage to create an inversion layer, which temporarily stores charge. The presence or absence of this charge represents binary data, which needs periodic refreshing due to its transient nature.