In baseball, a grand slam is a home run hit with all three bases occupied by baserunners ("bases loaded"), thereby scoring four runs -- the most possible in one play. According to The Dickson Baseball Dictionary, the term originated in the card game of contract bridge, in which a grand slam involves taking all the possible tricks. The word slam, by itself, usually is connected with a loud sound, particularly of a door being closed with excess force; thus, slamming the door on one's opponent (s), in addition to the bat slamming the ball into a home run.

Based on this passage, where did the term grand slam come from? Let's give stream of consciousness first:
To answer this question, we should know that: According to The Dickson Baseball Dictionary, the term originated in the card game of contract bridge, in which a grand slam involves taking all the possible tricks.
So, the final answer is the card game of contract bridge , in which a grand slam involves taking all the possible tricks.