He was riding on the subway in New York, when he saw a sign advertising "Ballgame Today - Polo Grounds". The Polo Grounds were the name of the stadium used most notably by the New York (later San Francisco) Giants baseball team.
During the 30-minute subway ride, Norworth, an accomplished songwriter, dashed off the words to the song. Soon thereafter, he took the lyrics to composer Albert Von Tilzer who created the popular tune, which later that year, became a #1 hit.
Stamps of Distinction has the story of how the song became a tradition across America, leading to the issuance of a commemorative stamp released today. Link -Thanks, Tony!