Difference between Memory and Disk space
What you need to remember is :

Disk space : slow to read/write but cheap, any computer has &gt; 100Go of hard disk
Memory : fast to read/write but expensive, usually a few Go

When you run an algorithm you usually use only RAM. In deep learning your dataset is often too big so you store it in the disk space and load pieces of it into RAM when needed for training.
There are tons of resources on the internet if you want to better understand how they differ (for example https://www.differencebetween.com/difference-between-hard-disk-and-vs-ram/)