They got lucky by hiring the right people for the X-Men franchise. From what i hear, they were constantly putting budgetary restraints on the first 3 or 4 films. People now seem to like looking down at X-Men 1, but making that film right was no small feat. At the time there hadn't been any good superhero film centered around a team, let alone one that also had complex moral themes at the center. Most of the problems in that film can be traced to budgetary cuts.
Bryan Singer's obsession with the franchise is also one of the reasons it was able to be resurrected. His development on First Class put an end on a few of the planned spin-off films. Then the studio started to realise X-3 and Origins had made people lose interest in the films, and so, gave Bryan Singer the control to do his dream X-Men film in Days of Future Past and were more careful with The Wolverine, giving the character his edge back.
With Fantastic Four, they have yet to crack a decent entry, so they don't have a good FF film to base their future decisions around, only failures.
While i'm a big fan of the X-Men franchise and hope it doesn't go back to the MCU, i'm still slightly afraid of it's future with X-Men Apocalypse. That story has the potential of being terrible, Bryan Singer never showed much interest in that story (unlike Phoenix saga or Days of Future Past), seems like the film will need to condense many plot threads and Apocalypse is more of an overpowered mutant, which doesn't bring in as interesting a conflict as Magneto did.
Deadpool seems to be a mix of Fox wanting to expand the X-Men franchise and Ryan Reynolds + Lauren Donner being passionate about the character.