If an aircraft is statically stable, it will always return to equilibrium after a disturbance. But what happens after can either show instability or stability. This is where the dynamic stability comes in.
You can think of an aircraft at equilibrium at a particular speed, altitude and angle of attack and it is suddenly faced with a disturbance which changes its speed, altitude and angle of attack. If the aircraft has static stability, it will immediately seek its equilibrium state. If the said aircraft also is dynamically stable, the amplitude of its motion will reduce in time. This is called subsidence. One of the major factors that affect dynamic stability is the amount of damping in the system. From now on we will consider the aircraft already is statically stable. When there is enough damping, an aircraft will slowly in time, reduce its amplitude until the amplitude goes to zero. Here the aircraft is said to be dynamically stable. If there is less damping the oscillations increases with time and the amplitude of motion also increases. This is called divergent oscillation. In this situation, the aircraft is said to be statically stable but dynamically unstable.
The aircraft has less dynamic stability at high altitudes where aerodynamic damping is lower. A pilot can also reduce the dynamic stability of the aircraft. If his/ her inputs are close to the natural frequency of the aircraft it can add energy to the system and the divergence increases. This is called Pilot induced oscillation (PIO).
Statically and dynamically stable.
Statically stable but dynamically unstable.
It is important to keep in mind that an aircraft, while it can be statically stable and dynamically unstable, it cannot be the other way around. That is, an aircraft can never be statically unstable and dynamically stable.