Because the favorite and the rival battled it out, he — the dark horse — reaped the benefits.

Literal

Favorite [and-と] rival [subject-が] competed thanks-to, dark-horse [possessive-の] he [subject-が] fisherman's-profit [object-を] gained [explanation-ってわけだ].

漁夫の利 (ぎょふのり, 'the fisherman's profit') is a 四字熟語-derived proverb — when two parties fight, a third profits. From the Chinese fable of the snipe and the clam. お陰で ('thanks to') marks the cause. ってわけだ is casual explanatory: 'so that's why.'