First, computer memory (RAM) is a type of temporary storage that holds data that is active, being used in the moment. For example, whenever you turn on your computer and Windows starts, the RAM is holding Windows itself, and any other program you might have configured to start when the computer boots up (i.e. antivirus, messenger programs, etc.) Every time you open another application, it takes up more space of your RAM. When you turn off the computer, RAM is wiped out, until you turn the PC back on again.
RAM works as an integrated circuit, basically a small board with storage chips on it. The computer and the operating system are programmed to allocate space on those chips for each application that the user accesses.