The sword of a samurai is his most precious and sacred possession. The sword was not only used to protect the samurai, but it also held spiritual significance because the samurai believed that his soul resided within the sword. It is therefore not surprising that the sword was made with the same respect and discipline as the samurai used to wield it.
The swords were not simply made in a mold and sharpened. The Japanese samurai sword is made from a complex process that involved heating the steel, folding it flat, then hammering again and folding. The repeated folding and hammering would continue as many as 30 times until the maker was satisfied that it was done correctly. You can also read more about Samurai Sword from various online resources.
Image source: Google
This labor-intensive procedure is necessary for many reasons. First, any air pockets that might have formed during heating the steel will be eliminated. An air pocket in a blade that appears solid would be considered a weakness.
Any artisan who is dedicated to making the best blades would do so as if his life depended on the blade he was forging. Second, layers were created by repeated folding and hammering. These internal layers look almost identical to the rings in a cross-section from a tree trunk if you take a book and roll up it parallel to the spine. This gave the blade much more strength.
The natural strengthening carbon elements in the steel, as well as impurities from the steel, would be spread throughout the entire sword, strengthening it. It wasn't enough to cool the blade in water. A second process was required. If steel cools quickly from high temperatures to cold, it becomes hardened and brittle.