This is a yojijukugo (4 character idiomatic compound). Most come from ancient Chinese, which is why their structure and meanings can be a bit perplexing. This one comes from the idea (or possibly a story, I can’t remember) that a snake that lived for 1000 years in the mountains and 1000 years in the sea would become a dragon. That’s the rough origin story.
It’s used to talk about someone who is old but can use their experience to outmatch you. Sly old fox is just an English idiom with roughly the same meaning and usage.
I made a list of one yojijukugo for each level of WK, for those who want to learn more. This one was in the list.