Both are software solutions to manage warehouse operations. Each has a different focus.
A WMS manages inventory by tracking inventory, stock locations, and stock movements, and can also be used to optimize picking and packing, while  providing real-time visibility of warehouse operations.
A WES optimizes warehouse processes such as receiving, picking, packing, and shipping, often via advanced automation or robotics. It increases efficiency by automating repetitive tasks and reducing manual labor, while providing features such as real-time task tracking, work optimization, and automated replenishment.
WMS and WES can be used together to improve visibility and efficiency.