In most styles, bibliographies are primarily sorted by authors names. Some authors would like to sort it also by document types, to distinguish between primary and secondary sources, for instance. This can easily be done by adding a simple macro and then adding it as the first sorting criteria of the bibliography. The subheadings must be added manually.
Click on "macros", then on the "+" at the top of the column, click on the "macro" button in the pop-up window, and give her a name, "sort-by-type", for instance. The "macro: Sort-by-type" appears in the macro list on the left, you can select it, click on the "+" and start entering the following instructions:
If you prefer to work directly on the code, it would look more or less like this:
<if type="book chapter paper-conference article-magazine article-newspaper article-journal manuscript report speech entry-encyclopedia" match="any">
<else-if type="bill legislation" match="any">
(this macro is taken from the Oscola Zotero style, which is already using this sorting criteria).