Answer by taking a quote from the following article:

Thomson was born in Glasgow, Scotland, the youngest of six children. He arrived in the United States two years later. His father, a cabinet maker, had moved to New York City shortly before Bobby's birth and sent for his family in 1925. Thomson grew up on Staten Island in New York City and signed with the New York Giants for a $100 bonus right out of Curtis High School in 1942.

Thomson became a celebrity for his walk-off home run off Brooklyn Dodgers pitcher Ralph Branca to win the 1951 National League pennant. The home run, nicknamed the "Shot Heard 'Round the World", was dramatic as, until 1969, league pennants were only decided by playoff when the teams involved finished the regular season in a tie. Prior to 1951 playoffs had only been necessary in 1946 (NL) and 1948 (AL).  Although in mid-August the Giants were 13 1/2  games behind the league-leading Dodgers, they won 37 of their final 44 games to tie Brooklyn on the final day of the regular season, forcing a three-game playoff. The Giants won the first game 3-1 as a result of a two-run home run by Thomson (off Branca). Brooklyn's Clem Labine shut out the Giants in the second game, 10-0. The decisive contest, played on October 3 at the Polo Grounds, was the first major sporting event televised coast-to-coast in the United States. The Dodgers took a 4-1 lead into the bottom of the ninth inning; but Giants shortstop Alvin Dark singled, advanced to third on a single by Don Mueller, and scored on a double by Whitey Lockman. With Lockman on second and pinch-runner Clint Hartung at third, Thomson's walk-off home run turned looming defeat into a 5-4 victory. The moment was immortalized by Giants play-by-play announcer Russ Hodges's excited multiple repetitions: "The Giants win the pennant! The Giants win the pennant!"  Waiting in the on-deck circle to hit behind Thomson was rookie Willie Mays. The Giants' season ended, however, at the 1951 World Series; the Yankees swept the last three games to win the best-of-seven series, 4 games to 2. Thomson batted .238 in the Series with no home runs.  The bat from the "Shot Heard 'Round the World" is in the collection of the National Baseball Hall of Fame and Museum in Cooperstown, New York. The uniform worn by Thomson on that day is apparently a part of a large private collection owned by Dan Scheinman, a member of the San Francisco Giants ownership group.

What was Bobby Thomson's role in this?
Thomson's walk-off home run turned looming defeat into a 5-4 victory.