  We investigate the vortex dynamics in two typical hole doped iron based
superconductors CaKFe$_4$As$_4$ (CaK1144) and Ba$_{0.6}$K$_{0.4}$Fe$_2$As$_2$
(BaK122) with similar superconducting transition temperatures. It is found that
the magnetization hysteresis loop exhibits a clear second peak effect in BaK122
in wide temperature region while it is absent in CaK1144. However, a second
peak effect of critical current density versus temperature is observed in
CaK1144, which is however absent in BaK122. The different behaviors of second
peak effect in BaK122 and CaK1144 may suggest distinct origins of vortex
pinning in different systems. Magnetization and its relaxation have also been
measured by using dynamical and conventional relaxation methods for both
systems. Analysis and comparison of the two distinct systems show that the
vortex pinning is stronger and the critical current density is higher in BaK122
system. It is found that the Maley's method can be used and thus the activation
energy can be determined in BaK122 by using the time dependent magnetization in
wide temperature region, but this is not applicable in CaK1144 systems. Finally
we present the different regimes with distinct vortex dynamics in the
field-temperature diagram for the two systems.
