Lets consider you have
e4 d4 pawns with white or
e5,d5 with black. When your opponent challenge your center with e5 or d5 with black, or with e4 or d4 with white of course his pawns are protected. How do you know if you have to push your pawn or simply capture the challenger pawn?
Lets consider you have
There are basically three possibilities:
Keeping the tension is often the best one: If your opponent resolves the tension by taking your pawn you can retake and centralise a piece and your remaining pawn often gives you a space advantage.
Taking is usually the least attractive option, but it can be good, if you are the first (or only one) to take advantage of vulnerable squares. So you might take on e5 if you can bring a knight to d5, possibly because the black c-pawn is already on c5, whereas your c-pawn can still control d4.
Pushing the pawn gives you a space advantage, but there is a big difference on which side of the board you get this space advantage! Pushing e5 gives you a space advantage on the king side. This can lead to an (piece-) attack against the king and is therefore a generally attractive option. It is not by random chance that against the French and against the Caro-Kann the e-pawn is often pushed to e5. Pushing d5 gives you an advantage on the queenside and this is only attractive if you can follow it up with play on this side of the board. Therefore it is generally more often played if you already have a pawn on c4, which is ready to be pushed to c5. If you need too much time to get your queenside play going, there will be the counter lever f5, which gives black play on the kingside.
For your general chess education it's important to know the textbook example Tarrasch-Marco, Dresden 1892.
[FEN ""] [Date "1892.07.18"] [Result "1-0"] [White "Siegbert Tarrasch"] [Black "Georg Marco"] [StartPly "8"] 1.e4 e5 2.Nf3 Nc6 3.Bb5 d6 4.d4 Bd7 5.Nc3 Nf6 6.O-O Be7 7.Re1 O-O (7... exd4)8.Bxc6 Bxc6 9.dxe5 dxe5 10.Qxd8 Raxd8 11.Nxe5 Bxe4 12.Nxe4 Nxe4 13.Nd3 f5 14.f3 Bc5+ 15.Nxc5 Nxc5 16.Bg5 Rd5 17.Be7 Re8 18.c4 1-0
White could have pushed the pawn
5. d5 with a small advantage, due to more space. Instead he kept the tension until black made a mistake with
7... 0-0?, when the correct move for black was to surrender the center with
7... exd4. After the mistake
7... 0-0?, white started a series of exchanges on move
8 that eventually wins a pawn. The moral: Don't take on
e5 before it's actually good. Also notice how white's moves
5-7support his center.
This is actually a stylistic situation: Space lovers enjoy cramping the opponent and denying his pieces room to move freely. By advancing the central pawn, oftentimes a knight is deprived of its most natural development square and may have to compete with its companion Bishop for use of a square. In the French Defense, Advance Variation, for instance, the Black King's Knight and Bishop can find mutual need for the 'e7' square. Tactical Players like keeping the tension by prolonging the attacking central formation which requires defense by the opponent. Simplification addicts may play for central exchanges hoping to keep strategy and tactics under control while they look for gradual improvement of their overall position and prospects over time. As previously pointed out by others here, there is no one right answer to the question.
The best position is usually two pawns on the same row. Once you push one of them, you create a hole that may be exploited. For example the hole can be used as an outpost for a Knight or a Bishop can block the pawns from moving forward. Like everything else, it depends on the position.