Many such limits come from data structures containing fixed-size fields where a count (of bytes, sectors, etc.) would be stored.
For example, the MBR partition table (the way modern operating systems use it) has 32-bit fields for sector count. That's four bytes, a "convenient" size for CPUs. (The more recent GPT partitioning format uses 64-bit values.)
The biggest number that could possibly fit in 32 binary digits is 232-1, or 4294967295 in decimal. For disks with 512-byte sectors, that means 2199023255040 bytes – just a sector short of 2 TiB.
You can find similar issues everywhere – the FAT32 file system can only have up to 232-1 clusters (although a cluster in FAT can vary in size; that's the "allocation unit" you see when formatting) and hold files up to 232-1 bytes (4 GiB) because of the same field size limit.
At the time when various filesystems were created, their maximum limit most likely seemed utterly ridiculous and "unlikely to be an issue", and it would have been quite inefficient to work with 64-bit or possibly even 32-bit numbers in a system running MS-DOS. (The early MS-DOS versions didn't even support folders!)
Nowadays filesystems use 64-bit counts, which is again "unlikely to be an issue" (264 is a lot).
But besides that, modern file systems have changed a lot. Instead of static inode tables or linear directory entries, they now grow as needed, and use structures such as B+trees. (I'm talking about NTFS, ZFS, possibly XFS...)