The 3-5-2 formation in soccer works by deploying three defenders, five midfielders, and two forwards, providing a balance between defensive solidity and midfield control.