One more thing I thought of; Remnant and Agony both seem to act a lot like Ectoplasm from Real Ghostbusters. Egon describing it as "the more you add, the bigger it gets" and that it's "only a matter of time before it wakes up and walks away." He also mentioned "When you touch something, you leave a mental imprint, like a fingerprint."
Also we know remnant and agony can be vectors for the memories and personalities of people to an extent. Afton likely infused himself with as much remnant and agony as possible during his experiments. He would also have produced it just by being alive and possessing the Spring Bonnie suit when he became Springtrap.
The Mimic, who is known to be corrupted by agony, had its programing used to create the digital animatronics for Help Wanted in universe. So when it scanned the circuits of various animatronics it possibly drew in their remnant and agony as well. Afton’s circuits likely had incredible amounts of remnant and agony, this combined with The Mimic's own agony and memories creating Glitchtrap. A digital fusion of Afton and The Mimic that sees itself as the real William Afton. That's why he remembers Tiger Rock, and why he wears a fabric Spring Bonnie suit instead of the spring lock version. But he also remembers Afton's life like his own, which is why he tries downloading himself into Burntrap. To "resurrect" himself.
Burntrap is literally Afton's corpse, so if Glitchtrap were to download himself into it, this would effectively resurrect William Afton. Gregory and Glamrock Freddy would destroy Burntrap but Glitchtrap remained because he's a virus. That's why they would go back and save Vanessa and she would create the security program. Unfortunately Glitchtrap would work with the actual Mimic to disable them. Glitchtrap would be destroyed by Vanessa and Cassie’s father but the original Mimic animatronic's fate is still unknown. Permanently closing the book on Afton.... until the next time Scott and Steelwool need him to bring in the big bucks.
But that's just my interpretation of Glitchtrap from everything we've seen. I know some of you will disagree with me and I don't mind that. I only ask you to be open minded and respectful to each other. Finally, remember to smile because you're the face of Freddy Fazbear's Pizza.