RAM stands Random Access Memory and ROM stands for Read Only Memory. As name for ROM , it only used for Reading stored data. RAM is used for bot reading and writing.
RAM is volatile which needs power and erases data once we switch off system. RAM directly relates to system operation to keep system fast. RAM uses cache and clears it once we switch it off, which means it just stores data temporarily. RAM as its directly operation with system is very fast compared to ROM and needs more power.
ROM is used for storing data permanently and it doesn't need power to be on to store data. However we can not write data on it as on RAM, as its Read -Only. If we compare with RAM it is fast but not as RAM and needs less power.
CPU can write down data or can access/operate data on RAM directly but not in ROM. If we consider cost, RAM is costly than ROM and RAM would be available in large size if we go for higher capacity compared to ROM.