This question seems to be thrown around a lot, and I wanted to weigh in with BigHat's view on this. Although, before getting into this, while I'm trying to make it as unbiased as possible, I'm trying to show why Magento holds the crown for many businesses, so apologies if it construes otherwise.
There's no denying it, both platforms have immense benefits to their users. They both have their pros and cons, which I'm not going to get into... Google is your friend, there's about 100 of them! :) I'm going to lay bare, the fundamental difference between the two, there's only one.
*Drum roll* - Being able to customise the backend architecture, pure and simple, in all its glory.
Shopify is a proprietary platform, just like Windows, Mac and that copy of Photoshop, you can't get into the underlying running architecture, the thing that makes all the magic happen. Magento noticed a gap in the market back in the mid-2000s, in particular, the open source (think Linux and the like!) side of it, and this is where has sat Magento and comfortably filled over the last decade or so.
Let's weigh an example in, one of our clients Shuttershack, had an extremely bespoke requirement. They wanted to be able to sell exterior shutters, where customers enter the measurements of the required sized shutters and would subsequently be fed to the backend order system. The frontend also needed to create the Shutters, and display in real-time to the customer, what they would receive.
I thought this was a great example to use, in that, if under any circumstance in your businesses lifetime, where you think you might need something where you have a highly personalised product, and the customer needs to add a lot of information. And importantly, pass this user entered data along to your warehousing system, production system to (oomph) a SOAP API, and unfortunately, many, many SOAP API's exist, typically attached to production systems. Magento is the way to go, this is a part of Shopify that you won't have access to, 'under the hood' so to speak.
Here's another example, our client ArtRepublic, were spending 1 to 2 weeks a month, inserting products into Magento manually. This was being duplicated from their warehouse management system. All taking up a lot of time and resources, needlessly. BigHat developed a new feature, which made use of their WMS API, and instead of them duplicating it and entering by hand we simply accessed the data via Magento, and then automatically created the products in Magento. Totally eliminating this 1 to 2 weeks which was being spent. Again, this is another example of something that couldn't be achieved with Shopify, as artrepublic's current WMS system is new to the market. If they were with Shopify, they would have had to move their WMS too, skyrocketing the associated costs.
The problem is, many merchants will move to Shopify, continue growing over the years, and then hit a plateau because they need to pivot with their industry. This pivot requires a custom feature on your website.
They've got this awesome new supplier in, but specific custom order data can't be sent to their WMS system. It's using some archaic 1990esqe spreadsheet, that needs specific character returns (Yep still in 2019!).
Again, not in Shopify.
And I think fundamentally this is where the great bonuses of Magento lie, it allows you do anything, if it can't do something out of the box, that's where we can come in as Magento Agency with all the benefits that entails, you could get a freelancer or even hire someone.
All those things that gobble up your staffs time, filling in a spreadsheet from an export, all can be automated by Magento and if you hire the right person, someone who can get that done for you in as little time as possible so you can see a return on investment within months.
So this cost balance ratio, which a lot of these Magento vs Shopify posts seems to be one of the key things they focus on. They don't tend to look beyond this into the businesses practices of just putting a product on the website. Someone doing this full time if you have an enormous rotating catalog. £20,000+ salary a year, over X years, or a single one-off cost with Magento, for the developer to create some code which automates this process? Where you will realise savings within a few months?
It absolutely depends on you and your business, the architect behind it, and if you feel you're going to need customisation, you're going to talk to lots of API's, doing all sorts of things, super custom product pages, Magento is the direction you need to take. If on the other hand, you think you can go with the flow of Shopify feature releases, then that's absolutely the direction you need to take. However... if on the other hand you can see your business doing the top end of 7 figures and encroaching into 8, again, really need to be considering what you might be doing, who you might be working with, what you're going to be integrating with to continue your businesses growth. Many, many things to consider. That proprietary nature will catch up with you at some point in the future.
I'm not entirely convinced on the cost argument as a result of the above, having worked for merchants inhouse, and a super rapidly growing one (creaking at the seams even with Magento). Not having the ability to modify internal business processes, they would have never have gotten to where they were. As they would have been spending a small fortune on headcount, keeping the operation moving.
Having a developer by your side, allows you to be at the far reaches of technological innovation, in your industry. And this is where push comes to shove, Shopify is designed to attract as wide an audience as possible, from all possible industries. And as a result, it gets very thin in the water for features that are now, desperately needed in specific industries.
By all means, for SME's, Shopify will pick you up and take you where you need to go. Just not if you have a very specific market and industry that you need to cater for.
Shopify is a really attractive solution for many businesses as a result of its jack of all trades nature, ticks most of the boxes and you get on with it. Magento is for when ticking most of the boxes, just isn't enough.