HFS supports extra attributes on files (type and creator codes for application binding) and two forks - one a traditional streaming fork - the other structured and accessed by an entirely different set of call interfaces (its a bit more like a database - you ask for a "resource" by type and id number and it gives you back a pointer to a buffer loaded with the data from the file).

When NeXT got started, they had this great language and great application library they wanted to focus on and otherwise just needed a reasonably modern OS to support this. Lacking vast resources they used as much free stuff as they could find. Rather than do a tricky file system, they decided that they could get the same behavior by making certain directories appear to be atomic units in the file browser and emualting forks with files within the directory. Add an extra file to store the attributes. Its the same functionality on a lower tech file system and it has the nice attribute of not getting broken when you move to a simpler file system like UFS.

Apple continues to push in this direction for the same interoperability reasons. Application icons on OS X are actually directories with names ending in .app. Inside the dir is a sort of properties file describing what kinds of files this app will open. Also a directory for the Resource files (.jpg, .tif, .gif , whatever else) and the actual executable.

This has the happy effect of allowing equivalent behavior on legacy file systems.

"Perhaps if you access a file as if it were a directory...? Then you could do ls /home/wwb/filename.sxw/* and see all the streams in it. A cp would copy the primary data stream, but a cp -R would copy all data streams. You could do things like cat filename.sxw/mime-type to see the MIME type. You could refer to a program's icon as program/icon.xpm. Hmm. This could get hairy. Would you want program/icon.xpm/mime-type to exist? The boundary between a file and a directory would get blurry..."

Yep - and on OSX it does. Functionally they're equivalent. Its all handled at a higher layer in the tools.