With the usual caveats about how "medieval" covers a thousand year period across several continents, they bought it from a guy!
People are surprised to find out that there were robust commercial networks between medieval cities, that cities supported complicated manufacturing operations, and that guilds maintained sophisticated commodities and labor markets. The general trend was toward more sophistication as populations increased and technologies improved (more or less to the present day with robots trading futures), and not every place and time would have had the bustling industry of, say, Paris after the thirteenth century. But commercial importation of raw materials was more or less a constant in medieval Europe.
It makes sense, when you stop to consider the kinds of objects we think of as "typically" medieval. The colors in the tapestries that adorned castle walls were accentuated with valuable silk thread brought to Europe on the Silk Road. Walk through the Cloisters or the Vatican Museums and you'll see exquisite miniatures carved from ivory--not to mention the ivory combs and hand mirrors and other elite domestic items. Ain't no elephants in Europe! That ivory came from India or Africa (and the African ivory is better). Look at this story that made the rounds last month about a woman identified as an elite scribe because of a fragment of lapis lazuli, powdered to make the vivid inks that colored manuscript illuminations. There's nothing more medieval European than one of those, but the blue ink made its way to Germany all the way from the Egypt or the middle east.
As these networks grow in sophistication, they (alongside phenomena like Crusading-colonialism and the lack of Mongols) create and concentrate wealth in Western Europe, which expands the market for these luxury commodities, which introduces economies of scale, which expands the market, and so on. You get trade guilds overseeing the whole operation, and debt and credit emerge to help the artisans buy raw materials from merchants who use credit to ship them (think of Antonio in the Merchant of Venice waiting for his ships to come in). Eventually, some Italians declare that all of this industry and market sophistication has set them apart from previous generations, and now your medieval metalworker is a Renaissance metalworker. And they're still buying their metal from a guy.
Sources
The basic argument that the abundance of trade is evidence of a connected and cosmopolitan medieval Europe is fleshed out in two essays in Andrew Albin et al. eds., Whose Middle Ages: Teachable Moments for an Ill-Used Past (Fordham University Press Fall 2019): Katherine Anne Wilson, "The Hidden Narratives of Medieval Art"; and Sarah M. Guérin, "Ivory and the Ties that Bind"
Ed. Oh and disclosure: I am publishing this book