When the comet is passing through the inner solar system, it is coser to the sun and according to Kepler's law, it will move more quickly when it is closest to the sun. Due to the high eccentricity of the orbit, it will take a longer time for a comet to travel through the far end of the orbit than through the inner system. Thus, the comet spends so little time in the inner solar system