You are not creating a DataLoader, but an ImageFolder which is a Dataset.
The ImageFolder dataset will lazily load and process each sample. If you wrap it into a DataLoader via:
dataset = ImageFolder(...)
loader = DataLoader(dataset, batch_size=..., num_workers=...)

each worker of the loader will load a complete batch and add it to a queue.
By default the prefetch_factor in the DataLoader is set to 2, which will load 2*num_workers batches.