The output of the collection.stats() function will mainly depend on the version of the MongoDB server. In your code, you have not mentioned your MongoDB server version. I think you are working with WiredTiger Storage Engine as this storage engine will by default compress all your data and indexes that are present inside your collection.
In the output, you are having 1.4TB of data(uncompressed) which is utilizing 334GB of the disk. In your indexSizes, the storage size that is being used by indexes is described separately.
To help you gain a better understanding, here is a Full Stack Developer Certification Course provided by Intellipaat.