One possible reason could be that Peter is really good at hiding it. He's careful with his actions and words around Tony, so Tony just doesn't suspect. For example, he always changes out of his suit before meeting Tony.
This situation can create a lot of opportunities for character growth. For Peter, he has to keep this huge part of his life hidden from someone he respects like Tony. He might struggle with the lies and the secrecy. For Tony, when he eventually finds out, it could be a shock that makes him re - evaluate his relationship with Peter. He might feel betrayed that Peter didn't trust him enough to tell him, or he could be impressed by Peter's ability to keep such a big secret.
Peter might be embarrassed at first. He's been idolizing Spider - Man and now Tony, a real - life hero - like figure, knows about it. But then he realizes that Tony could be an even greater source of knowledge and support, so he becomes more open about his love for Spider - Man.
Maybe Tony took away some of Peter's Spider - Man gear without a good explanation. Peter worked hard to get where he is with his suit and abilities. If Tony just confiscates it for what Peter sees as no valid reason, he would surely be angry. After all, the suit is an important part of how Peter operates as Spider - Man.
Well, Tony might be initially surprised. He could then start to use Peter's love for Spider - Man to his advantage. Maybe he'd give Peter more tasks related to Spider - Man tech, knowing that Peter would be more motivated. He might also start to train Peter in a way that's inspired by Spider - Man's abilities.
Well, Peter could also use his intelligence to create false alibis. Whenever there's an incident where Spider - Man is involved at the same time Peter should be somewhere else, he has a well - thought - out excuse ready. He might say he was at a study group or helping an old neighbor, and since he's known as a smart and helpful kid, the Avengers would be less likely to suspect him.
Yes, Tony Stark does know who Spider-Man is in the comics. They have interacted and formed significant relationships over the course of various storylines.
One great fanfiction idea could be that Gwen discovers Peter's secret identity in a really unexpected way. Maybe she stumbles upon his Spider - Man suit while looking for something in his room. This would create a lot of drama and tension between them as she has to decide what to do with this knowledge.
A great plot twist could be that Peter ends up saving one of the Avengers in his Spider - Man identity, but the Avenger doesn't recognize him at all. Later, when Peter is in his normal self, he casually mentions some details about the incident that only the person who was saved would know. This makes the Avenger start to suspect that there's more to Peter than meets the eye.