The first one has a lower damage and dps than the second, but when i equip each, the first one gives more overall damage then the second. How come??

Maybe in your set of affixes . Somehow .

Dps is bonkers… And maybe the first one suits the other items in your build…