This doesn't mean that they change radically, but they do change. That is why each set of orbital elements comes with the epoch, a date for which the elements are valid. However, even months before and after the epoch, a given set of orbital elements will work sufficiently well for most applications. Gravity from the Sun is why the comet is in orbit around the Sun in the first place. However, gravity from all the planets affect the comet.
Most comets typically go through the inner solar system with no major changes to their orbits.
It is well-known that comets have vents that produce jets of dust and gas when exposed to sunlight. These jets act as little thrusters. While the effect of individual jet at any given moment is extremely small, over time these little thrusts will modify a comet's orbit slightly. The effects of these non-gravitational forces show up more in periodic comets that return to the Sun's vicinity frequently. These non-gravitational forces can be modeled and included in the ordit determination.