What's the purpose of A and B partition slots if both are flashed? I recently play with LineageOS flashing (or actually adb-sideloading) tutorials, but I guess my question is more generic.

In my device there are A and B partitions for everything except the userdata partition (and maybe something else). I understand the purpose is to provide extra safety against bricking. Should anything go wrong during a flashing operation, there's the other slot.

Now, every tool and manual procedure I have seen flashes both A and B. Doesn't it render the whole concept useless? What's the gain from A and B slots if we keep on putting the same to both?
every tool and manual procedure I have seen flashes both A and B.

This is not correct-
Update engine does not flash both A and B, 2 slots exists for rollback purpose if updated slot does not boot up.