2 linked guides. Start at part 1 or open the chapter that matches your question.
Why KB and KiB are not the same—decimal SI units (1000) versus binary IEC units (1024), where each is used and how the gap grows from kilobytes to terabytes.
A 1 TB drive shows as about 931 GB—here is the real reason, why nothing is missing and how decimal versus binary units explain the gap on every disk.