A defending queen in the centre blocks the pawn, covers all four directions, and leaves the attacker no safe way to advance. Centralisation is worth more than checks when the pawn is still far from promotion.
Not every queen-and-pawn ending is about perpetual check. When the pawn is still on the fourth rank, the best defence is often to centralise the queen and simply sit in the pawn's path. Black's queen on d4 does exactly that: it controls e5 (the pawn's next square), the long diagonal, and the fourth rank, so the e-pawn can never advance safely and the white king cannot approach without walking into checks.