Its the cruise control servo. One cable goes from the transfer case to the servo, and then a 2nd cable from the servo to the speedometer. You could get a non-cruise cable and just connect it directly from your transfer case to the speedometer. I found one for my '75 K20 at Autozone for about $18. However, its a PIA to get it connected up to the back of the speedometer.
1. I would unscrew the cable that runs from the servo to the speedometer (the one running over the firewall), and chuck the end into a drill. If you can spin it with a drill and get the speedometer to work, then the problem is lower in the system. IIRC, I think you have to run the drill in reverse.
2. If speedometer worked in step 1, then put the upper cable back on the servo and disconnect the cable at the transfer case. Do the same drill test to determine if that cable is good.
3. If the first two steps work, you have to fix the connection at the transfer case. The speedometer gears are plastic or nylon, and available from most parts places.
Bruce