How does copying files work with regards to RAM, and can I speed this up?
Solution 1:
You are witnessing a "Data Buffer", which is a standard part of (practically) all computers.
From that Wikipedia link:
In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another.
Buffers are often used in conjunction with I/O to hardware, such as disk drives...
In short: Yes you are on-track in your thinking, and getting more RAM will help speed up file transfers. The difference depends on a lot of things beyond RAM though (file sizes, number of files, etc.) and the long-term storage mediums (disks) are the bottleneck to speed 99% of the time.
Solution 2:
You are correct that the data is read into RAM and then the write to disk is scheduled. So long as there is more free RAM, the reading does not need to be delayed to let the writing catch up. However, the actual writing speed is not affected. The writing actually has not finished when the copy finishes. The operating system continues flushing the data from RAM to disk.