Read Only Memory (ROM) is used by PLC for storing operating system. The operating system is programmed by the manufacturer.
Random access memory (RAM) is a Read Write memory and used by PLC to store temporary data like status of I/O pins, temporary results of calculations, timer counter values etc.