Base WooCommerce is free, but a large amount of the functionality you need to actually build a working store is provided by additional plugins.
Most of these have a freemium model where the features you actually need are gated behind a monthly or yearly subscription. More than a few of these plugins and the monthly price can easily be more than something like Shopify, especially when factoring in hosting.
Each of these plugins also feel like they need to justify the cost, so often come larded with their own dashboards, UIs and other junk, whereas a simple script would often be better.