You extended small-to-large merging from sets to maps. The same complexity argument applies: each element is moved times total. You also learned how to maintain auxiliary data like max frequency and sum while merging. You update these values incrementally as you merge maps.
This pattern is common in competitive programming when you need aggregated statistics per subtree. The technique handles both simple sets and complex maps with the same efficiency guarantee.