The most common comparison is also the most misleading: a monthly subscription on one side, a free licence on the other. Both models cost money, but not at the same moments and not on the same lines.
What you pay on a hosted platform
The subscription is the visible part, and the easiest to plan for. Then come three lines that get forgotten at decision time.
Transaction fees. Depending on the payment solution you use, a percentage may sit on top of banking fees. This line has one particular property: it grows at exactly the rate of your sales. A store that works pays more.
Apps. Every function missing from the core is added through an app, usually with a monthly subscription. Taken one at a time they look modest. An established store often accumulates a dozen, and the total becomes a fixed charge.
The theme and its adaptation. A purchased theme covers the generic. Everything that makes the store recognisable takes work, and that work is redone at every major change.
What you pay on a self hosted store
The licence is free, which moves the spending rather than removing it.
Hosting. A store is not a brochure site: database, cache, backups, handling load on busy days. Entry level hosting does not hold up.
Maintenance. The most frequently forgotten line, and the most expensive one to ignore. Security patches, updates, keeping modules compatible with each other. This work is not optional: an unmaintained store ends up compromised, and the cost then arrives all at once.
Modules. Often bought once rather than rented, which changes the spending profile. But a module abandoned by its author becomes a problem at the next update.
Development. This is what you are actually buying with self hosting: the ability to do exactly what your business requires.
The line nobody puts a number on
Your team's time. A store takes hours every week: product records, stock, orders, customer service, campaigns. An interface that wastes ten minutes a day for one person costs more over a year than most of the lines above.
It is also the only line you can durably reduce, by fitting the tool to how your team actually works.
How to compare honestly
Do not compare a month. Lay out three years, and for each one: fixed fees, fees proportional to sales at your expected volume, the cost of maintenance, and internal hours. The gap between the two models often moves over time, and the cheaper option in year one is not always the one that stays cheaper.
One last point, rarely accounted for: the cost of leaving. Recovering a catalogue, customers, an order history and hard won search rankings does not cost the same on every platform. Check that before committing, not after.