Stability of orbital resonance Recently I've become more interested in the topic of the stability of planetary systems. I have been reading about it and it seems that orbital resonances play an important role in the stability of Solar System (as well as in the moons of Jupiter and other planets).

I first thought that the orbital resonance is somehow more stable and thus we have several cases in the Solar System.

But as I kept reading, I found out that in the asteroid belt there were some gaps precisely where the resonances happen, so the resonances are actually instable for asteroids.

I then thought that some resonances are stable while others are instable, but some of the resonances that makes gaps in the asteroid belt are actually present in the Solar System between planets, so I am completely lost.

Why resonances are sometimes stable and sometimes instable? What am I missing?
Maybe I am misunderstanding something because it doesn't make sense to me. Any help will be welcome.
I am not very familiar with orbital dynamics (so please correct me if I'm wrong). I was told that, for instance in the case of the mean motion resonances that cause the majority of the Kirkwood gaps in the asteroid belt, not only the ratio of the periods, but also the timing is important. 

Let's take Pluto as an example, which is in 2:3 resonance with Neptune. Although Pluto crosses Neptune's orbit, both bodies will never get closer to each other than a certain threshold. That is, because the timing between their orbits was preventing close encounters in the first place, which is then enforced by the resonance. 

If the timing was different, close encounters would be possible, thus destabilizing the orbit of the smaller body. In the case of mean motion resonances, there is an algebraic expression that allows to investigate the stability of a resonance (see, e.g., here https://en.wikipedia.org/wiki/Resonant_trans-Neptunian_object [toward a formal definition]).