Folder
A folder, called a directory in most technical contexts, is a file-system object whose purpose is to hold references to other files and folders, giving them names and a place in a hierarchy. It is the organizing device that turns a flat pile of millions of named blobs into a tree a person can navigate: a documents folder containing a projects folder containing a folder for one project, and so on down to individual files.
A folder does not physically contain its files; it records names and pointers. On Unix-style file systems a directory is a special kind of file whose content is a table mapping each name to an inode number, and NTFS and APFS use comparable indexed structures. The files' data sit elsewhere on the disk, and the folder merely says what each entry is called and where its metadata lives. This explains several everyday behaviours: moving a file to another folder on the same disk is nearly instantaneous because only directory entries change, whereas moving it to a different disk requires copying every byte and then deleting the original, and a single file can appear under more than one name through hard links.
The hierarchy comes from folders nesting inside one another, with a single root. Multics, developed in the 1960s, introduced the tree-structured file system, Unix adopted it, and MS-DOS 2.0 added subdirectories in 1983 after early versions had only a flat list per disk. Every folder except the root has exactly one parent, and the special entries "." (this folder) and ".." (the parent) are present on Unix-style systems, so commands can climb the tree. The shell tracks a current working directory, which is why a program started from one place can see different files than the same program started from another, a frequent surprise when scripts are run from a scheduler instead of a terminal.
The word "folder" is a metaphor that arrived with graphical interfaces. Xerox's Star workstation of 1981 and the Apple Macintosh of 1984 presented directories as picture icons of manila folders, borrowed from paper filing, and Windows 95 adopted "folder" as its everyday term while the command line kept calling the same thing a directory. The two words are used almost interchangeably, but the metaphor is imperfect: a physical document can sit in only one folder, while a digital file can be reached through links, shortcuts or search from many places, and some "folders" shown by a graphical shell, such as This PC or Libraries in Windows, are virtual views rather than real directories on disk.
Folders carry their own permissions and some quirks that differ from files. On Unix-like systems the read permission on a directory lets a user list its names, the write permission lets them create or delete entries, and the execute permission lets them pass through it to reach what lies below, so removing a file depends on the permissions of its folder rather than the file's own. Symbolic links add pointers to other folders and can create loops that tools must guard against. Performance also depends on size: directories holding millions of entries are slow to list on naive designs, and modern file systems use tree indexes (ext4's HTree, for example) to keep lookups fast.
Several pitfalls are worth knowing. An empty folder is real on the file system but is invisible to Git, which tracks file content only and so ignores folders with nothing in them, which is why projects add placeholder files such as .gitkeep. Deleting a folder normally deletes its whole subtree, a destructive command that has caused many accidents when a variable in a script turned out to be empty. In data and machine-learning work, folders also serve as a loose labeling convention, since many image datasets expect one folder per class name, so a misplaced file is silently a mislabeled training example.
Read a folder as a named index rather than a box: it holds nothing but names and pointers to other objects, which is why moving things between folders is cheap, why one file can seem to live in several places, and why the tree it forms is a navigation convention laid over storage rather than a property of the bytes themselves.