[FEN ""] 1. e4 e6 2. d4 d5
Following the structures with black pawn on c5, there is a tension in the center. When does black usually decide to take the d4 pawn, what is usually the trigger?
Generally speaking, resolving tension helps the defender. White is the defender as far as the d4 square is concerned so Black should not aim to play c5xd4 unless he gains some follow-up advantage by doing so. One such advantage might be access to the b4 square for a knight or bishop after the reply c3xd4.
Adding to what TheMathemagician said, sometimes you will find that your c5 restricts your position, such as blocking your dark squared bishop. If, for instance, you prefer to have a bishop on c5, you might want to think about capturing on d4 just to get access to that square.
Similarly, the c5 pawn could restrict a Rook on the c-file. If you want to use that file to the full potential, you will eventually have to open it with a capture.
Of course, there are also cases where the capture is practically forced due to your c5 pawn being attacked twice, especially if white goes for a b4 push.
The trigger for me is having nothing else useful to do. At some point you need to develop your dark-square bishop and castle. Moving the bishop only to then have your opponent release the tension wastes a tempo.