Here z-index is set to auto (the default if it isn't set), so these are drawn in the source order - young Olivia, then text, then older Olivia.
Two pictures of Olivia the Rottweiler puppy
Here we explicitly set z-index to 2 for young Olivia, 3 for text, and 1 for older Olivia.
Two pictures of Olivia the Rottweiler puppy