Whonix splits the job in two. The Gateway VM runs Tor and nothing else interesting. The Workstation VM, where you browse and run apps, has no direct path to the internet; its only network connection goes to the Gateway. Even if malware gets root on the Workstation, it can't learn your real IP because the Workstation never knew it.
That's the main contrast with Tails. Tails is amnesic and portable but runs everything in one system. Whonix is persistent and installed, built for long-running identities and for people who need software beyond a browser. It runs in VirtualBox or KVM on a normal host, or inside Qubes OS as Qubes-Whonix, which is the setup the project itself tends to recommend for higher security.
Whonix is based on Kicksecure, a hardened Debian derivative from the same developers, and ships with stream isolation so different apps use different Tor circuits. The weak point is the host: if your host OS is compromised, the VMs are too. It also asks more of you than Tails does. Read the documentation at whonix.org before you rely on it.