Briefly :The z-index sets the stacking level (order) of elements on the page. The lower the z-index the further down the stack the element will be. (A stack is just the term for elements on the page and which one is on top of the other one like a stack)
Elements that are positioned on the page are usually displayed in the order that thay are in the html. e.g. the first element will overlap the second element. (assuming of course that areas of the element overlap). By setting the z-index you can control which element is on top and is wholly visible to the viewer.
z-index applies to positioned elements and a parent element that has nested elements will have their z-index controlled by the parent (in relation to other elements outside the nest). Each child element may overlap any other of the child elements according to the z-index set but will only overlap other elements outside the nest if the value of theparent is greater.
I think I've just made it sound more complicated than it is
ComputerBob beat me to it (and more eloquently as well:) )