Solar activity undergoes a variation over timescales of several months known as Rieger-type periodicity, which usually occurs near maxima of sunspot cycles. An early analysis showed that the periodicity appears only in some cycles and is absent in other cycles. But the appearance/absence during different cycles has not been explained. We performed a wavelet analysis of sunspot data from the Greenwich Royal Observatory and the Royal Observatory of Belgium during cycles 1424. We found that the Rieger-type periods occur in all cycles, but they are cycle dependent: shorter periods occur during stronger cycles. Our analysis revealed a periodicity of 185195 days during the weak cycles 1415 and 24 and a periodicity of 155165 days during the stronger cycles 1623. We derived the dispersion relation of the spherical harmonics of the magnetic Rossby waves in the presence of differential rotation and a toroidal magnetic field in the dynamo layer near the base of the convection zone. This showed that the harmonics of fast Rossby waves with m = 1 and n = 4, where m (n) indicates the toroidal (poloidal) wavenumbers, perfectly fit with the observed periodicity. The variation of the toroidal field strength from weaker to stronger cycles may lead to the different periods found in those cycles, which explains the observed enigmatic feature of the Rieger-type periodicity. Finally, we used the observed periodicity to estimate the dynamo field strength during cycles 1424. Our estimations suggest a field strength of 40 kG for the stronger cycles and 20 kG for the weaker cycles.