Inside a container set to display: flex; flex-direction: column; min-height: 100%, give the element you want centered margin-block: auto (auto on both top and bottom). Flexbox's auto margins absorb all the leftover space in their direction, so the top and bottom margins grow equally and land the element exactly in the middle.
What makes it special is that the same code works whether a header or footer exists or not. With a header present, margin-block: auto centers within "the space between the header's bottom and the footer's top"; remove the header, and that available space simply expands — nothing in the code has to change. position: absolute plus transform: translateY(-50%) can't offer that flexibility, since it ignores the parent's actual content and always pins dead center regardless of siblings.
It's exactly the pattern for a hero section that needs to fill the full viewport height while carrying a logo or a single line of copy stacked on top.
When to use
Use it for full-screen heroes, login screens, or 404 pages — anywhere content needs to occupy the whole viewport while staying centered within it.