The Queen's Gambit is not a true gambit as the pawn will almost always be recaptured with additional benefits for white. There's not much point in trading a centre pawn for a flank pawn so it's better to maintain the d5 pawn with e6 or c6.
The King's Gambit is a true gambit as black can capture the pawn and hold onto it. Also f4 weakens the kingside so deflecting black's e5 pawn away from the centre comes with additional risks for white.
why is the best move in the Queen's gambit is to decline the gambit, while the best move in the king's gambit is to accept the gambit?