It is also the case that a suitably large body in orbit around a central body, will tend to disturb nearby orbits, destabilising them and often forcing anything in those orbits into a more stable orbit (frequently a multiple of the size of the main orbit), or ejecting it from the system.
This "clearing" effect is part of the definition of what makes a planet a planet, as opposed to an asteroid.
Planets, in general, are big. This means that they won't tend to be disturbed much by anything much smaller than a planet, or even other planets in the solar system; in other words, most orbits are stable. So although there will be a gravitational pull between 2 orbiting planets, because the orbits won't have the same time period, the orbits will go out of sync, and the gravitational effects will cancel out over the long term. The exception is if the orbits are extremely close, and have such similar orbital periods, that you get a prolonged gravitational attraction at one point, which is sufficient to destabilise one or other orbit.