Kennedy's Moonshot speech was a direct response to the Soviet Union's early lead in the Space Race, marked by milestones like the 1957 Sputnik launch and Yuri Gagarin's 1961 orbital flight, aiming to restore American technological and ideological prestige amidst the Cold War.