det is used when referring to a neutral-gender (t-words) word, while den is used for commen-gender (n-words) words. But if you are not referring to anything speciffic, you just use det
That is not a semantic connection but a homonym. Bad luck. The words happen to be very similar in my language too, apparently here they are even more similar.