You mean a memory chip?
In simple terms each 'bit' of memory contains a capacitor which can store a small amount of electricity, and a transistor which can measure electricity.
To write a 'one' you fil the capacitor with electrical charge, to write a zero you empty the capacitor.
To read the memory the transistor measures if there is electrical charge on the capacitor or not.
You can fit a lot of them on a chip because you can make both the capacitor and transistor very small - only a few 100 atoms wide.