In a generic role-playing game, the party has more say in the direction a story goes than the GM. To make things more interesting, though, GMs might try and implement the classic secret society bit – put each adventure into a greater linking chain with a nice wrap-up at the end, as everything falls “right into someone's hands.” Maybe the mastermind is only working for themselves or maybe they're working for a higher goal. How do you pull that off without just overruling player actions, like when they spontaneously decide to demolish the key piece to the puzzle? Careful string-pulling, a plethora of foreshadowing and the quantity of potential masterminds are each a factor to such an execution.
What is your organization's goals? Whether world domination or outright deicide, they're going to be operating on a large scale in the world where the PCs are also operating on a large scale. Eventually these two will cross paths and probably even butt heads. If that's your goal or not, in order to save for (or stave off) that big climax you're going to need to pull strings. The mastermind(s) have echelons of underlings and don't put themselves at risk. Even meetings with the party are staged: a body double appears and questions the party with a predetermined script while the real deal remains hidden in the shadows (the more strings being pulled, the better).
That “we should have known” moment is well worth the investment. In order to pull it off, you're going to need lots of red herrings. Each of those don't have to lead nowhere of course, but they will need to hint at greater machinations. Are they or are they not real? Well, as the party plays out their agendas, you can refine the many hooks you've thrown them and decide what to keep and what not to. On the other side of the DM screen it will look as though you had it planned all along. Definitely throw many malleable hooks first, then specific hooks later – when you (or better yet, the NPC mastermind) can better predict how the party might act.
One of the greatest downfalls of secret societies can be likened to a chessboard. Once you bring a piece into the game, they're much easier to target. What's the fun in having a powerful king if you can't flaunt their might now and again? Secrecy can be maintained but the biggest risk is that once they're on the board, the party will destroy them. Never underestimate the lucky shot, and never rely on the variable die roll to keep your kingpin safe. Should the entire plot rest on that sole character's actions, the whole model likely falls apart after their demise (or at least shifts radically).
Instead of having a single “dragon” kingpin (and the risks associated with mortality and/or destruction-prone antics) set your adventures up so that multiple people fit the bill. Make a “hydra” secret society where any one of five or ten powerful people could turn out to be the mastermind “all along.” Start with more characters and more variety, then as events occur you can narrow the list down. Keep only the viable options in the running so that a party expecting a spellcaster (due to plot events) isn't disappointed by someone without even a single magical spell or item. Basically what you're doing is playing a game of cards, dealing the party members one hand each but yourself several. Then you just play it by ear. Happy sneaking!