The .DS_Store file is one of the most common invisible files you'll come across, simply because there are so many of them. The file, in a nutshell, contains information about a directory (and its files) in the Finder. The file is created whenever the directory is viewed in the Finder; thus, directories that have never been viewed in the Finder will not contain this file. The main variables that this file stores include:
Location of icons in a window (when "Keep arranged by..." is not selected)
File comments (editable via Get Info)
State of the window's toolbar & toolbar visibility
Size and position of the window
The file itself is a proprietary binary format that no one has been able to decipher thus far; it if were open, we could do some really cool tricks and hopefully understand it much more. Until then, though, we can only look at its more noticable roles.
While there are obvious benefits to these files, sometimes they can be a nusiance. For example, browsing an OS X machine (or directories from one) will usually show these files unless you change the preferences of the FTP client. Another example is the use of software like radmind to manage lab computers. Because these software packages list every file on the system, it shows just how many of these files exist on your system. Some software packages (Stuff-It Standard 7.0.3, for example) will contain these files when you download the software. While this is the decision of the developer, most software packages do not contain this file.
While it may be important to save the .DS_Store file for frequent windows like /Applications and /Users/username, other directories don't really need the file kept around. Every .DS_Store file can be safely deleted, but the attributes it retains will be lost upon deletion. Deleting the file can also be beneficial in situations where window settings are not being retained or something else is occurring that might hint towards a corrupted .DS_Store file.