When I replaced my cable because cold temps (under 10 degrees) the past two years caused the speedo to go crazy and a loud buzzing sound would follow. I pulled the cluster the speedo was fine from swapping it out with a donor cluster. But I just recently replace the speedo cable and the housing at the base of the transmission was cracked letting in a lot of crud...looked like it was about to completely break. The last 6 inches of the cable leading up to the tranny was filled with black oily crud that was pasty. Tried all easy stuff first like lubing he cable from the top but no effect. I think the lube actually cause the issue to worsen over time. Toughest part about replacing it is the routing and getting the cable seated in the transmission. Fixed all my issues and the speedometer does not bounce around too.
So to your question...the crud and corrossion of the cable causes it to bind and twist funky till it breaks....causing your speedometer to act up. My intial thought was a faulty speedo, so I ordered a used speedo and still did the same thing. If it is your speedo...I found alot of places that could rebuild VDO speedo's for about 150-175 plus shippping. IM me if you want mine as it's just laying around..I'll give you a good deal