PHP memory_limit setting applies to the maximum memory limit which is used by a single request/script/process. It helps prevent poorly written scripts from consuming all available memory on a server. For example, if 3 PHP scripts are simultaneously using 100 MB of memory each, that would total to 300 MB of memory usage, and a PHP limit of 128 MB wouldn’t be hit.
The RAM memory is responsible for storing and making all the data needed to run a process or script available. Basically, the system’s RAM itself is what will allocate memory to these processes or scripts, as well as leave some reserved memory to ensure the proper function of other programs/services in a system.