From when he was a young man Albus Dumbledore has long held belief in the "Greater Good." What is this Greater Good exactly? That the wizarding world, at long last emerge from the shadows to stand as the lords and rulers of the muggles as they were always supposed to be. He plotted first with Gellert but the collapse of their relationship and Gellert's subsequent failures taught him that the wizarding world could not be forced to see this obvious truth, instead they must be guided there.
As such Albus set himself up in Hogwarts, gradually climbing the ranks until the school was his domain, and he began finding people who he could guide, shape into his disciples, guiding them into places where, in time, they could finally enact his plan.
It didn't go smoothly, some of his lesser pawns went rouge, most notably Tom Riddle; the wizarding world was divided between light and dark, with the neutrals swinging whichever way the wind was blowing, Dumbledore couldn't rule both factions, he needed to have someone to rule the dark. Riddle seemed like a perfect choice, but he broke away, instead of taking the reigns of the Dark Faction, he became a dark lord, preaching blood purity like he wasn't a son of a muggle and a squib.
Ultimately Dumbledore had been able to come up with a plan to deal with Tom, a false prophecy to pit him against another obstacle; the Potters. James Potter and his Marauders had long clashed with Albus, his shielding Slytherins like Severus Snape from the consequences of their bullying of muggleborns (done in the hope of gaining their trust to mould one of them into his Dark leader) and cost him their respect as they took dishing out this punishment into their own hands. That one of his hopeful pawns, Lily Evans had eventually seen James' side of things and turned on him made it burn all the brighter.
Dumbledore had learnt the Potters were pregnant, and soon stepped into action, using seers to find the date of birth, then using the imperious curse to get that fraud Trelawny to make a prophecy while Snape was spying on him. As he had hoped Tom targeted the potters, and, having manipulated Sirius Black and the Potters to make the cowardly Peter Pettigrew their secret keeper not Sirius himself, the rat told Tom, who came there, killed James and Lily, and tried to kill their son Harry, only for protections Lily worked on destroys Tom's body.
Of course things didn't go to plan, as soon as Albus saw Potter, he knew he was a Horcrux for Riddle, and that he had more Horcruxes, or else this one would never have occurred.
And so Albus engineered a whole complex plan, reaching out to as many of the children who would attend Hogwarts with Potter, including several muggleborns, like Hermione Granger, training them to revere him and fulfil their role in his plan, and once Potter returns to the wizarding world, things play out exactly as Albus planned, until Potter's 6th year.
Albus hadn't planned on Tom's curse killing him before the endgame; Potter was meant to die, and then Albus would emerge and kill Tom, solidifying him as a hero, but his impending death forced him to adapt, coming up with a new plan to direct the rest of the battle.
It worked to an extent, but to Dumbledore's surprise, not only did the weapon survive the final battle, but his disciples made mistakes when he did. In the aftermath of the battle they stunned the boy, claimed he had committed war crimes, and thrown him in Azkaban, and their connection to his other Disciples to get people to accept it.
The issue was that they assumed that, with Riddle gone, they were they only faction left action, but they were wrong, because Potter had allies of his own.