Why some folders have the .DS_Store but some doesn't?
Locally stored .DS_Store files

In brief

A common reason for presence of .DS_Store: 


in Finder, a view is preferred. 


Technical details

An answer to Why are dot underscore ._ files created, and how can I avoid them?: 


Purposes of .DS_Store and ._ files