They can both do the same job in raising and lowering an anchor, but while a winch collects the anchor rope around a self-contained drum, with a windlass, the pulley (called a gypsy) passes the rope or chain off again into a separate collecting area. It’s usually a more complex installation, relying on having some below-deck storage, and better suited to chain/rope anchors than rope alone. Windlasses are usually quite a lot more expensive than winches, too.