Of all the Avengers in the Marvel Cinematic Universe pantheon, Ant-Man has probably gotten the smallest end of the stick. In the comics, both Ant-Man (Hank Pym) and Wasp (Janet van Dyne) were part of the Avengers founding line up when the first issue arrived in 1963. However, the MCU replaced them with Black Widow and Hawkeye for the film, and pushed the introduction of a Scott Lang Ant-Man to the tail end of Phase II, with Hope van Dyne as Wasp only properly added post -Infinity War. What happened to Ant-Man before Avengers: Endgame? Despite their johnny-come-lately status on screen, these characters are significant.
Having skipped the Hank Pym and Janet van Dyne characters in the run-up to the first Avengers movie, the MCU decided to introduce the series by starting in a non-traditional spot in the story. Pym was aged up, with Michael Douglas in the role, and turned into an Ant-Man who was no longer interested in wearing the mantle. (In the opening scene, he's shown quitting S.H.I.E.L.D. in hopes of suppressing the technology altogether.) All that changes when Scott Lang, on a burglary mission for his best friend Luis, accidentally steals what he mistakes for a motorcycle riding outfit, only to shrink down when he tries it on.
Having discovered a new man to wear the suit, Pym dubs Lang the new Ant-Man. Pym's daughter, Hope van Dyne, becomes friends with Lang, helping him in his Pym-appointed mission to steal and destroy a "Yellowjacket" suit based on Pym's research. Along the way, she learns her mother Janet, the original Wasp, was trapped and probably died in the subatomic Quantum Realm, a universe only accessible via the Pym particles behind Ant-Man's abilities. It's why Pym abandoned his research and wants to suppress it. Lang accidentally enters the realm during the movie's climactic fight but survives and returns.
When Ant-Man & The Wasp begins, Lang is under house arrests due to his refusal to comply with the Sokovia Accords during the events of Captain America: Civil War. However, after Lang is contacted by Janet (who is still alive in the Quantum Realm), Hope, now using the Wasp suit, kidnaps him, with plans to find her mother.
Instead, Lang and Van Dyne find Ghost, who turns out to be Ava, the daughter of one of Pym's original partners at S.H.I.E.L.D. Ava is quantumly unstable from her father's work and hopes to track Lang to the Quantum Realm to get particles to cure her. After a few misunderstandings, where Pym believes Ava wants to kill Janet to get those particles, and Ava believes Lang and Hope want to prevent her from ever getting better, all is resolved, though not without a few spectacular fights. In the end, Pym enters the Quantum Realm and rescues Janet. Janet then gifts Quantum particles she brought back to help stabilize Ava.
Unfortunately, Janet doesn't bring back quite enough, so Lang takes another trip back to the Quantum Realm to harvest a few more. While he's in there, the snap happens, and Pym, Janet, and Hope are all dusted, leaving Lang potentially trapped forever.
The trailers for Endgame show Lang will find a way home, but how is still a mystery. Fans will find out when Avengers: Endgame premieres on Friday, April 26, 2019.