They're two different people, separated by 36 years and an ocean:
Key's poem circulated as a broadside with the note "Tune: Anacreon in Heaven." The pairing caught on organically. By the Civil War, it was a de facto national anthem. Congress made it official in 1931.
Four stanzas exist, though only the first is commonly sung. The third ("No refuge could save the hireling and slave...") references enslaved people fighting for the British—a contested passage in modern discourse.
So: Key wrote the words; Smith wrote the music. Neither lived to see their combined work become the U.S. national anthem.