As you can see in this little video, the function of the Dataloader is to be able to return directly to you the batches of data.
If your Dataset class implements the method __getitem__(self, index : int) -> instance of your data, the Dataloader is supposed to use it (efficiently) to give you directly the data batches in your loop.