To better study the importance of the collision of different magnetic systems in generating magnetically complex sunspot groups and major (M- and X-class) flares, we define the index ALW: Area/LW, where LWrepresents the latitudinal width of the sunspot group band, and Area represents the total area of sunspot groups within the latitudinal width. Then, using the sunspot-group data collected by the United States Air Force/Mount Wilson Observatory and the flare data recorded by the Geostationary Operational Environmental Satellites, we investigate the variations of the ALW-index, the percentage of complex sunspot groups, and the percentage of major flares in the northern and southern hemispheres during Solar Cycles 22, 23, and 24. The main findings are reported as follows: First, in most cases, the maximum percentage of complex sunspot groups occurs after the maximum ALW is reached, and ALW starts to decrease. The result suggests that the collision of different magnetic systems cannot affect directly whether more complex sunspot groups are produced or more complex sunspot groups may be produced when there is a lower probability of the collision of different magnetic-flux systems, which does not support the suggestion of Jaeggli and Norton (Astrophys. J. Lett. 820, L11, 2016). Second, in most cases, the maximum percentage of complex sunspot groups occurs after the maximum percentage of major flares is reached, and the percentage of major flares starts to decrease, supporting the suggestion of Nikbakhsh et al. (Astron. Astrophys. 629, A45, 2019) - the large-scale dynamo peaks before the small-scale dynamo starts increasing, and the complex sunspot groups are linked to the small-scale dynamo taking over after the large-scale dynamo starts decreasing.