The truth about how it happens is
-- First something succeeds
-- Then people make up reasons for that success.
-- Those reasons are almost always wrong and self-serving (not that I am saying it's the case at you, this isn't directed at you personally).
Spider-Man wasn't the first teenage superhero or the first to grow on-page. Fawcett's Captain Marvel whose alter-ego, Billy Batson, started out as a kid grew to teenage years as did Freddie Freeman who became (confusingly) Captain Marvel Jr [best known for being Elvis Presley's role model and childhood hero]. Likewise alongside Spider-Man you had the X-Men who were also teenage superheroes who went to school but they didn't catch on in the 1960s, or make it big until the late '70s when the cast all aged up and you had mutants come in (Storm, Wolverine, Nightcrawler) who are fully formed adults. If you break it down, it's hard to argue that Spider-Man being a teenager was the prime or essential reason for his success. It's not a case that teenage superheroes are inherently more successful with teenagers more than other kinds. Spider-Man's sales increased after all when he graduated high school and went to college and they also increased when he got married.
I think that the reasons for Spider-Man's success is the second part of your statement. I think the fact is that Spider-Man had this once-in-a-million unique costume design which when put together by Ditko, alongside his gimmick, made him instantly appealing. Without the red-and-blue costume, Spider-Man would most likely not have done as well as he did.
Today Spider-Man's main income comes from merchandise, toys and stickers and so on, and young children know and love Spider-Man long before they find out he's Peter Parker or what age he is, or anything else about him, being that they're too small to see the cartoons or movies or play the games.
You look at Batman and Superman, the fact is both of them have these amazing costume designs which have this simple iconography and aren't fussy and ultimately the visual element is the main thing that propels these characters.