This happens if the file is so small that its contents and the filesystem bookkeeping fit in 1KB. To save disk space, NTFS keeps small files "resident", storing their contents right in the file record, so no cluster has to be allocated for it. Therefore, the size on disk is zero because there's nothing beyond the file record. Once the file gets sufficiently large, NTFS makes it "nonresident", allocates one or more clusters for it (creating a nonzero "size on disk"), and creates a "mapping pair" in the file record in the place of the data to point to the cluster.
SSD hard drives or Windows 10 don't affect this; it's simply an NTFS feature. Further reading: The Four Stages of NTFS File Growth.
Note that the "size on disk" metric isn't exactly right. For instance, it never includes the constant 1KB that the NTFS file record takes up. The metric was introduced in Windows 95, which didn't use NTFS and therefore couldn't have accounted for this phenomenon; it just showed the file size rounded up to the next multiple of the cluster size. That estimation algorithm was carried through to Windows 7, even though many Windows versions between them used NTFS and resident storage. It was finally updated in Windows 8 to count files with only resident data as zero-size on disk. Further reading: Just What Is 'Size on Disk'?
4Short answer: If no additional space on disk is needed to store its contents. – David Schwartz – 2016-01-25T01:52:43.200
11@Thomas Not a duplicate. The name sounds similar, but that question is asking why Windows declares a zero-byte file to be zero-size despite requiring registration somewhere. This question asks why the size on disk can be zero even if there is data in the file. – Ben N – 2016-01-25T16:41:13.010
3
Related: How can an large file have a zero “Size on disk” value?
– BlueRaja - Danny Pflughoeft – 2016-01-26T00:36:45.200@BenN Is flagging it inappropriate because you are right it is certainly not a duplicate. – William – 2016-01-29T06:44:30.967
Hi Coder88, I believe the person who flagged your post as a duplicate was mistaken - the other question was asking something different; you really did ask a good question. If you meant to indicate that your question is solved, you can click the check mark next to an answer here. – Ben N – 2016-01-29T19:31:32.490