This is a useful feature for making longer documents easier to read. Previously, all of your headings would be completely expanded, making it easier to read documents. However, this can make reading longer documents difficult. People will have to scroll through Page after Page just to find the correct heading. This is in which Google Docs’ collapsible headings will come in handy.
When you create a new heading, you will be given the option of enabling collapsing. When you collapse a heading, all of its contents are removed until you expand it again. If you have “View and comment” access, you can expand and collapse settings while reading a document.