There are two mechanisms:
1) The right bit has to be addressed. The bits can be arranged in a 2D scatter, and in a 1Mbit chip that could consist of 1024 horizontal and 1024 vertical electrical lines. In order to write a bit, it would set one of each to high voltage and one the rest to low voltage. The bit, where both the horizontal line and vertical line is set to high voltage, is the one that is written to.
2) The bit information has to flow into the bit cell. In dynamic RAM, this is a simple capacitor.
The logic to see, if the horizontal and vertical lines are both high-voltage, and the capacitor, can be combined into one very simple layered circuit on a chip, which basically occupies almost nothing and is regarded one of the smallest items that you can put on a chip. However, the capacitor-part is lossy, i.e. it loses the electrons over time. Therefore, every single bit in the RAM chip needs to be read and re-written over and over again. This is why it is called dynamic, and this is why the computer loses it's memory when turned off.
Reading uses the same logic to pick a bit cell, and basically empties the capacitor, if there are any electrons. Reading a cell that contains electrons therefore requires that the cell is written immediately afterwards, again.