Metal use dates back about 7000 years, and predates the understanding of metal extraction, Back then production consisted only of beating exposed copper nuggets found on the ground into tools.
Metallurgy, consisting of the study of extracting metals from their particular ores through the process of smelting began about 3800 years ago in Iran. Extracting the copper through heat would require some understanding on the part of a prehistoric metal smith, and that scientific knowledge surely was discovered by accident. Perhaps some particular rocks around the campfire began oozing out metal that some ancient realized was the same stuff that they had been occasionally finding on the ground. But the knowledge of manufacturing the metal into implements, or the technological applications, already existed. So technological application preceded scientific understanding.