Confused about timing of cxd5 and dxc4 in the Queen's Gambit Declined (QGD) Recently I've been playing the Queen's Gambit Declined as my primary response to a d4 opening by white. While analyzing past games with engines, I've realized that as the game progresses, there's a point when suddenly whoever plays cxd5 and dxc4 gets a huge advantage. For example, maybe there's position rated -0.6, then it becomes -1.1 on black's turn recommending the pawn exchange, and if black doesn't play it, it suddenly becomes +0.2 for white to take the pawn. 

This advantage is seemingly more valuable than developing pieces and seems to drastically change the position. Though it is is important to note the white fianchettoed their bishop on g2, making the position similar to the Catalan, noted by Alexander Woo in the comments section.

Something else I noticed about the position is that if black loses their d pawn, the engine doesn't really care, but if white loses their c pawn, the engine's rating of the position drops from -0.2 to -0.8.

It seems that somehow, before a point in the game, playing this exchange is highly unfavorable, but at a random moment, it becomes very favorable, such as when I develop my queenside knight in any way, the engine suddenly recommends the pawn exchange, which doesn't seem like it does anything.

Could someone who is experienced with or knows a bit of theory please explain to me when this move should be played, its purpose, and its effect? I've checked a few online guides but they only talk about the early moves in the opening and none really elaborate on the purpose and timing for the pawn exchange here.

[Here](https://lichess.org/8PIQ8KUh/black is an example game I played of what I'm talking about.

Please ignore my horrible attempt of a kingside attack but the engine starts fixating on the pawn exchange for either side at move 6 for both white and black.
In the various standard variations of QGD, the answers to this question are somewhat different, but you should keep in mind Black's main goals.  Black's main problem is that they don't have enough good places for all of their bishops and knights.  The worst piece is the light-square bishop, but the other minor pieces are also problematic.  Hence Black's main goal in the latter stages of the opening are first to exchange off some minor pieces and second to free up the light-square bishop in some way.

Let me start with the Tartakower (1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. Nf3 h6 6. Bh4 0-0 7. e3 b6)  In this variation, Black tries to put the light-square bishop on the long diagonal.  Naturally, black wants to play dxc4 so that the d5 pawn isn't blocking their own bishop.  White doesn't want to allow this, so the standard continuation is 8. cxd5 Nxd5 9. Bxe7 Qxe7 10. Nxd5 exd5.  The light-square bishop is now free, and Black has managed to exchange one pair of bishops and one pair of knights, but white has managed to prevent Black from putting their bishop on a dangerous open b7-g2 diagonal.  (This argument also applies to the Capablanca variation of the Orthodox.)

Next consider the main line of the Orthodox (1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. Nf3 0-0 6. e3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5)  In this variation, Black is achieving the exchange of a pair of bishops and a pair of knights by moving their knight to d5.  They need to move their pawn out of the way in order to achieve this.  However, they delay taking this pawn until White has moved their bishop.  The point is that this bishop now has to move a second time to retake the pawn, wasting one move.  White delays moving the bishop as long as possible, and Black delays taking the pawn as long as possible, but it turns out White runs out of other useful moves before Black does.

In the Lasker (1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. Nf3 h6 6. Bh4 0-0 7. e3 Ne4 8. Bxe7 Qxe7), one plan for white is to retake on c3 with the b pawn and exchange off the pawn on c4.  This in effect exchanges the b pawn for the e pawn and gives White more pawns in the center, at the cost of giving Black pieces more space.  There are some variations with 9. Rc1 that see the pawns stay around for a while.  On the other hand, if White plays Bd3, Black can take the pawn and force White to move their bishop a second time.