郁郁 has two distinct meanings depending on context: (1) gloomy/melancholy, as in
郁郁寡欢 (gloomy and cheerless); (2) lush/luxuriant vegetation, as in
郁郁葱葱 (lush and green). The two senses are connected by the idea of 'dense/full' — one of dense foliage, the other of dense emotional weight.