<Document> and <Folder> are types of Container, they can co-exist separately within a single KML file, and/or be contained within each other. By default the <Document> and <Folder> element are closed and invisible (unchecked).
New KML:
<Document>
<Folder>
<open>
<visibility>
(1) Locate the Golden Gate Bridge in San Francisco and mark with a Placemark.
(2) Name it Golden Gate Bridge and add a brief description.
(3) Save as GoldenGate.kml.
(4) Open GoldenGate.kml in a text editor and simplify the KML to a <Document> and <Placemark> parent elements containing <name>, <description>, <point> and <coordinates> children.
(5) Create a new Folder under My Places and name it Bridges.
(6) Save the Folder as Bridges.kml.
(7) Open Bridges.kml in a text editor.
(8) Combine the two KML files to create one file of a <Document> called San Francisco, containing one <Folder> called Bridges, containing a <Placemark> called Golden Gate Bridge. Save as SFgate.kml.
(9) Open SFgate.kml.
(10) Expand the document and folder contents.
(11) Uncheck all the left-hand boxes associated with this KML.
(12) Open SFgate.kml in a text browser.
(13) Copy San Francisco from the Sidebar (in Google Earth) and paste on top of the current SFgate text (in the text editor).
(14) Note the addition of several examples two simple elements <open> and <visibility>.
(15) Try changing the values of these elements (they can be 1 or 0) , saving the file each time and viewing the effect in Google Earth.
(A) Create a KML file that will replicate the image at the top of the page. Note the different default states of the folders and placemarks. Click on the image for a larger view.