speedo question

I think that there should be a threaded collar on the trans end of that cable to screw it onto the trans if it were an automatic. I'm not sure about manual trans, none of my cars are manual...

What was holding it in the trans so it didn't come out before???