I am an aspiring chess player and I just discovered this famous opening a few months back. Currently I am using Stockfish as my go-to reference to find the best move, but unfortunately it does not explain why a move is considered good. The question is why the move c5xd4 is vital for black, and how does it benefit white?
2...cxd4 is the best move because it challenges White for coming up with something. If White just takes the pawn back with 3.Qxd4, Black can easily gain a tempo with 3...Nc6.
The gambit starts with 3.c3. White is sacrificing a pawn for rapid development (4.Nxc3 recaptures the pawn with a developing piece), open bishop diagonals (b3-f7 diagonal) and slightly better central control. Black is unable to move the central pawns two squares immediately (...d5 loses a pawn, ...e5 weaken the d5 square).
White has some compensation for the pawn but probably not enough against a skilled player. Black is still very solid, if Black can stop White's swift attacks, the extra pawn will pay off.
2...cxd4 isn't vital for black in the sense that all other moves lose, but more in the sense that there is not really a good reason to avoid taking the d4 pawn. It's hard to think of another move that fights for the center control as well as ...cxd4.
As for how it benefits white: the point of the Smith-Morra gambit is that it is a gambit; white will sacrifice a pawn after 2...cxd4 with 3.c3, in exchange for a tempo in the opening, which is intended to give a head start for white to attack the black setup.