What properties form a stacking context?
Stacking contexts are not only formed when applying z-index to an element. There are several other properties that cause elements to form stacking contexts.
For example, it works with CSS filter. Here we applied a CSS filter to the blue div, which doens't have a z-index defined. Nevertheless, it forms a stacking context like in the previous examples.
Check what are all the properties that are creating a stacking context.