Partly that's due to clustering: They produce hundreds of Merlins per year vs their competitors which only produce like a dozen or so (often less) engines per year, so just from the learning curve they can save a lot of money.
And unlike essentially every other rocket in the industry, the two stages are largely similar, using the same pressurization scheme, same propellants, same diameter tooling, just differing by the length and number of engines (the Merlin Vacuum engine is significantly different than the Merlin 1D sea level engine, but same underlying cycle type and same heritage), so it's almost like they only need to maintain half the production line as their competitors and get the economies of scale of producing more of the same thing. Also, they're reusing the vast majority of the hardware on roughly half their flights, now, which is, unhyperbolically, a game-changing development in commercial space launch.
SpaceX has a LOT going for them right now. Falcon 9 is a very inexpensive launcher given its performance.
The thing about rockets is that there's a huge advantage in having a higher launch rate. If you're not launching a lot, you're still paying most of your labor and facilities cost just to sit idle. And SpaceX, just producing a single rocket family that is launching more than anyone else in the world (and reusably), is at an enormous advantage there.