The katana has never been the 'main' weapon of samurai except for the Edo period when they were essentially not allowed by Imperial law to carry any other weapons and the manufacture and storage of weapons was strictly regulated by the central authorities (to maintain order and of course make rebellion incredibly difficult when your master has all the firepower).
And while the Edo period was relatively a time of peace for the nation, that doesn't mean that there weren't battles. There were localized rebellions, separatists, bandits, religious conflicts, etc.
And of course, there were personal conflicts between individuals and houses/clans/families. The men who had their status due to their supposed proficiency in combat and martial skill would have continued to train and prepare for eventual combat.
As the decades of relative peace and lack of major warfare distanced the warrior class from the Sengoku period and any actual major combat, combat itself and what being a samurai meant were purposely romanticized. Duels were not uncommon and of course tournaments would have been held. Men who had never seen actual war would want to prove themselves, as young men are prone to do.
This is also when the 'soul in the sword' thing began.
Before this, the true weapon of a samurai would always have been his bow. His most practical weapon would have been the spear. And his deadliest weapon would have been his firearm.
The sword has always been a sidearm at best in times of actual major conflict and was more often used to cut the heads off their kills, after they were long dead, so they could bring them back for promotion.
The quality of katana has always been questionable. The myth that every katana is a masterpiece is ridiculous, especially considering the rate that they would have to be made during wartime. They were also considered not as important to manufacture as spears.
The cost to make one katana would have been enough to make a dozen spears.
That being said, there is no doubt that there were smiths who were incredibly skilled in their art and did create masterwork swords. These, like anywhere else, were special because they were exceptional in their quality, not the average.
The average katana would have been decent but likely not excellent, due to the generally low quality of ore to be found in Japan.
The best pieces would have been passed down and as the katana was romanticized in the Edo period, so would it's production. Famous swords as well as their creators would become legendary. Master smiths surely lived and worked in the Edo period as they did in the Sengoku period.
The major difference would have been that they would not have been as pressured to produce pragmatically with the time and material pressures of war. This lead to more chances for more artistic pieces and selectivity in allowing only the best pieces out into the world.