Since the game doesn’t persistently despawn some mobs, it will eventually take up a lot of memory and processing power to keep their locations and statuses in check. This can cause it to stutter, lose FPS, and eventually possibly crash from a lack of available memory to use. Killing all mobs essentially clears a significant portion of the used memory if the world has been open for a long time. However, when these mobs get killed, any of the loot they drop will be stored in the memory again, which slightly diminishes the command’s effectiveness.