It is said to have been invented by Johann Kiefuss of Nuremberg in 1517, and the idea probably came from the spring driven tinder lighter in use at the time. The idea of this mechanism is simple. Have you ever used a modern lighter which has a flint pressed up against a roughened metal wheel? When you spin the wheel with your finger, the flint pressed against its surface throws off sparks. The same system was used in these firearms to create sparks as needed to ignite the gunpowder to fire the gun. No more waiting to get a wick lit, and no more stressing about it going out when the fog rolls in.
In 1530, Charles V, the Holy Roman Emperor who ruled over Spain and Austria, imported the brothers Marquarte to transfer their workshops from Augsburg to Madrid. They brought to Spain unsurpassed knowledge of firearms production.
The wheel lock design was eventually improved with more durable springs, their main weak point, and a cover over the wheel mechanism to protect it and keep it dry. The wheel lock was an expensive gun to make and a matchlock cost less than half as much, so it was impossible to equip a complete army with the more costly mechanism. Only a person of substantial wealth could afford one for himself.
By around 1560 German gunsmiths were using wooden stocks and adorning them with inlays of ivory and horn. At about this time the metal parts were fire-blued to add extra beauty and to protect against corrosion. Also, metallurgy had improved to the point that gun barrels were no longer bursting very often. The strongest barrels were of damascene manufacture. In this process, strips of metal about the thickness of a man's finger are wound together. Then, another strip is wound around them for the full length of the piece, then the whole thing is heated and welded. It is hammered and forged into the final shape, then bored out. The damascene barrel was the only one that could survive being packed for its full length with gunpowder then fired. Other gun barrels were at risk with only a quarter of their length packed.