The stacking order refers to the order in which elements are painted on the screen along the z-axis. Elements with a higher stacking order are painted on top of elements with a lower stacking order.
According to the stacking order, this issue occurs when the div.relative has a higher stacking order than the div.sticky (the div.sticky appears before the div.relative in html). There is no solution without z-index.