Recently I had a file that reported a file size of 33P bytes in my 500GB SSD, more details here. That was through ls and cp would report that there was no enough space.
In my short knowledge and poor understanding of VFS, I would believe that the (SATA) drivers talk to the disk and it moves its way through the VFS until it makes it to the inodes (assumption from the description on section 8.6 Inodes here) and then the kernel somehow pass it to user space.
In the end, I like to know how ls and cp know the size, but I would also like to know how a file could report the wrong size and if it were to happen again in the future, where to look for answers.