RAM stands for Read Only Memory where as ROM stands for Random Access Memory .
RAM is a primary memory or we can can say Main Memory. The memory space of RAM is very low as compare to Memory given to ROM. Rom is a secondary memory. The task which OS needs to perform comes in RAM because its much faster then ROM. When their is a power cut the data information might get lost in RAM we need to process it again. But nothing happens with Secondary Memories (ROM). This is the benifit of secondary memory. All the pen drive and hard disc are Secondary Memory.
If you want to know in more details about how OS works comment down below.