Let us take an example perfect edge. An edge is a mathematical line, at the intersection of two planes or curves. The perfect edge is perfectly straight and perfectly thin, that is, with zero width. Any deviations from straightness or thinness make it worse at cutting.
An atom is the thinnest width that a physical edge made of atoms can have. That's at the atomic scale. A medieval sword might be a million atoms across or worse, with a broad, blunt edge pressing and scraping across whatever you want cut. Already we are losing cutting ability.
The perfect edge is made of perfectly strong material that never wears away (chips, burrs, or cracks). In the real world, it must be made of atoms, which have bonds of limited strength to their neighbors. When that bond's strength is overcome, the atom is ripped away or shoved away from the line, distorting the straight edge. Chips, burrs, and cracks appear in the line. We are losing more cutting ability.
If you want to cut through steel armor (or another sword), you would need a very thin, unbreakable line for the edge. In science fiction, Larry Niven's Variable Sword is appropriate. The Variable Sword is a handle, a little glowing button to show the end, and between them an invisibly thin unbreakable stiff thread. It wielder cuts through most objects without effort.
A real-world sword is made of atoms, which support each other and form the 99.9% of the sword that isn't edge. (99.999999...) The atoms must be bonded together so that the sword doesn't wear away quickly. But materials have several different measures of "strength": compressive strength, tensile strength, hardness, how far the shape can bend and still return to its original shape, etc. The melting point is important, too, as well as characteristics as the solid heats up, because a hot sword is easier to bend.
Medieval crafters don't have the materials science to define good steel, let alone create good steel, let alone create a large amount of good steel repeatedly. If they somehow got their hands on an excellent non-steel material, they would have a very hard time putting into the shape of a sword, let alone putting an edge on it.
Let's imagine they isolated ten pounds of tungsten (it's almost thrice the density of iron). They would need the materials science to make a ceramic mold that could withstand its tremendous melting temperature. That makes a sword-shaped object with a blunt edge, and they have to put tremendous amounts of time and effort into sharpening it. And still, its edge would be a million atoms across, and still, using it blunts the edge.
Other very hard elemental metals have similar problems. Some of them are quite toxic as well.
Let's imagine they acquired a sword that is a single crystal of diamond. Nice and light, but it will chip and shatter easily. Also, the carbon gets absorbed into iron and steel it presses into, so the edge will quickly be ruined.
Long story short - steel is used for swords because it's the best compromise known of all the problems known. A society needs science to be able to define better materials. Better materials are frequently just more-precisely-understood steel with vanadium, tungsten, molybdenum, etc. And it's still not going to cut through armor or other swords without blunting.