What is the z-index property, and how does it work?

z-index controls the stack order of positioned elements. Higher values appear on top.