Put simply the best Dunkers are the most explosive, and best athlete's, and of course being good at basketball really helps.
Vince Carter
Jordan
Wilkins
Dr J
Blake Griffin
Sean Kemp
All powerful explosive jumpers. Some guys are more smooth Athletic like Clyde the glide and Zach Lavine, but if you can jump 43" like Lavine can. Your a freak athlete.
Gerald Green might jump higher than all of the best Dunkers ever, he's just not all there mentally.
You do have to be able to get over the rim to throw it down, but being explosive doesn't mean you can dunk well in a game.
There are lots of guys who can really jump and can do incredible dunks in a layup line, but rarely dunk in games.
Consider Paul Pierce and Kevin Garnett. Garnett could probably reach a foot higher if they both had a clear path, but Garnet struggled to dunk any time there was a defensive challenge. Pierce was much better at dunking over defenders.
Leaping ability, balance, strength, aggression and big hands all matter, but Garnett had all of those, and still was a lousy dunker. It's a particular type of talent. Some guys just don't get thrown off by defensive challenges and some do.