Have you ever looked at a classical peice name? For instance Presto in C minor.
"Presto" is the speed at which it is played, and when it says C minor, that means the song is made within the scale(s) of C minor.
But to figure out a key just by hearing a song is something that comes with age and experience.
When attempting the impossible, you achieve the best possible