.DS_Store (Desktop Services Store) is a hidden file created by Apple Inc.'s Mac OS X operating system to store custom attributes of a folder such as the position of icons or the choice of a background image. By default, Mac OS X will create a .DS_Store file in every folder that it accesses, even folders on remote systems (for example, folders shared over a SMB or AFP connection) and even if the user has only customized the appearance of the folder by moving its Finder window. This is in contrast to the preexisting system for the same purpose used in previous versions of the Finder, which would merely place a number of invisible files at the root of the volume being accessed (even on alien filesystems), always storing the settings and metadata for all of the folders in the entire volume within this single set of files.
After complaints from users about these files being created on remote systems, Apple posted an article on their support site telling users how they can disable the creation of remote .DS_Store files over network connections.
Although these files were initially primarily used by the Finder they were envisioned as a more general purpose store of metadata about the display options of folders such as icon position and view settings. For example, since Mac OS X Tiger (10.4), .DS_Store files contain the Spotlight Comments of all the folder's files.
Earlier versions stored user sensitive information which was easily uploaded via FTP to websites (the files by default not visible to the user but accessible by the FTP client) where the exposure of this data could lead to security exploits. This data has since been removed.
In Mac OS X 10.5, .DS_Store files are now invisible on the Windows filesystem.