RAM full form is Random Access Memory. RAM stores the data and files on temporary basis when these are being processed by CPU.
In other words, when there is a request for data or content from your website or app hosted on a cloud server. It first comes at RAM from storage and remains there till the request is being processed by CPU.
RAM does not store data forever, When power goes down, the data is erased from RAM.
The Size of RAM impact cloud server performance.
Take a general example- There is a sudden spike in the demand for videos on your website that is hosted on Cloud hosting server. If RAM size is more then your user would feel more speed.
Note- a high ram should also be complemented with more CPU for better cloud hosting performance.