Based on what criteria do you add/not add icons to labels within a toolbar?

Some toolbars have icons for each label, and some toolbars do not have icons for any label. There is enough discussion about that.

However, some toolbars will attach icons to label selectively, and on that I cannot find any type of discussion. Here is an example from Intellij:

enter image description here

The leftmost toolbar attaches only few labels with icons, while the rightmost toolbar almost attaches all the labels with icons.

The majority of the discussion is about whether to rely only on icons, only on labels, or combine them. There is no discussion or reasearch about selective use of icons in the same toolbar.

While it could be argued that "save all", "print" and "open" are "iconified" due to these actions being ubiquitous with easily relateable visualizations, "project structure" does not satisfy that idea. There are also many other features like "export" and "import" with easy visualizations that can be iconified.

I wonder if there is a practice that guides when to add an icon to a text label, and the extent to which one could add iconfs to labels before there is clutter (if there is such a limitation).