Samurai sword making took what, a thousand years of trial and error? The forgers had no idea how making steel worked, they just found a way to make it work.
They had to get pretty creative in their use of ironsand to produce high quality steel.
Notably phosphorus is very hard to get rid of when it's in your metal. Before better metallurgy, the best steel worldwide was made out of low-phosphorus ores.