How does FLASH keep its contents after disconnecting it from Power Supply? Why RAM loose its contents in the same situation? Both of them keep the logic values in capacitance, aren't?
RAM cell is based on 2 inverters driving each other. when the power is off, the power level is between them is discharged to zero and the value of the cell disappears.
FLASH cell is based on floating capacitance which remain disconnected after poweroff and hence the charge in it remains.
It is recommended to read the wikipedia pages of either memory for further explanations.