First, there are the two gears in the trans tailhousing. The drive gear that's on the trans output shaft (usually slid over a clip on the shaft) that turns the driven gear (in the housing with the numbers on it, as mentioned. There is a bushing in that aluminum housing. The gears can wear as well as the driven gear shaft and the housing's bushing.
The speedo cable indexes into the square hole in the driven gear shaft. That end of the cable is pressed "square" for that, as is the other end of the cable where it indexes into the speed cup on the speedometer head.
That rear part of the speed cup mechanism is were the bar magnet is. The cable turns it and the magnetism in turn, turns the front side of the speed cup, which is attached to the speedometer needle. The speedometer needle is "zero'd" by a thin clockspring. There is a bushing in the speed cup that can wear and deteriorate. Replacements are usually bronze, especially if the originals are plastic.
What the cable turns in, the sheath can also wear on the inside. Sometimes, it'll wear through any inner wear surface and directly contact the wire mesh in the sheath, IF the casing is not metal, but a plastic vinyl material.
ANY prior lube in the cable and in the speedometer head can evaporate, become gummy, and need cleaning and replacement with time. General Motors used to have a tube of "Speedometer Cable Lube", which was kind of like Dippity-Do hair gel, but a lubricant. Graphite is a classic lube from times past. White grease/lubriplate has been used, too. Main thing is that it's light, will not gum up with time, and remain "in place" during hot/cold cycles.
Once cleaned, things should work well, if there is no wear in the system. In some cases, it might be best to seek out a new cable assembly. Transmission shops can have replacement gears. Getting a cable assembly that's made for the car by a speedometer shop is much better than getting a universal cable from an auto supply, by observation. There's a speedo shop in MI that advertises in some hobby publications. I've heard good reports on his business as he came from the automotive industry himself. He can probably make anything you need, cable-wise.
To check the calibration, you can use GPS on a smartphone for distance and speed. Calibrate distance FIRST, as that relates to the number of cable revolutions per mile. Speed comes next as it's the strength of the magnet that determines how the speedometer needle moves, which is a variable calibration by a speedo shop (if there still are any around that does that in your area).
CBODY67