This is a common expression and ‘as cunning as a fox’ suggests that someone is very sly and underhand because a fox is known for doing things in a way that you cannot guess. The fox, as it were, does something behind your back and you don’t realise it.