is a phrase which often functions as a conjunction between the (A) and (B) parts of a sentence in order to show that (B) is ‘in addition to (A)’.
This structure stems from the common use of the noun お負（ま）け which indicates a ‘discount’ or ‘freebie’ that is added in addition to the base of (A). Despite お負（ま）け itself primarily being used for positive things お負（ま）けに
may convey ‘in addition’, ‘on top of that’, or ‘what’s more’ regardless of whether the original topic is a good thing or not. However, (A) and (B) will always either be both good things, or both bad things, never a mixture of both.
Being a combination of お負（ま）け and に, this phrase will appear either at the beginning of a new sentence, or at the beginning of a second clause of a 2-part sentence.
Today was one of the worst days because I got yelled at by my boss for being late to work, and to make it worse, I upsetted one of our clients.
Yesterday, my boyfriend treated me to a delicious dinner and on top of that he even gave me a gift.
My computer won’t turn on. To make matters worse, my smartphone is out of battery, so I can’t work at all.
Fun-fact - An important distinction between phrases like それに and お負（ま）けに is that お負（ま）けに keeps its original meaning of (B) being some kind of ‘bonus’. What this means is that whatever the speaker is trying to convey, (A) by itself is enough to meet some specific qualifications, and (B) is just adding ‘insult to injury’, or ‘icing on the cake’, depending on whether it is a good or a bad thing.