Eat your heart out may have varying meanings depending on the context.
In modern contexts, it is mostly used in a humorous manner, calling out someone who is being overcome in their own profession or talent.
I.e.: There’s no better seducer than me. Eat your heart out, Casanova!
However, in a more antiquated sense, the idiom is used to describe a feeling of grief that is coming from the loss of something dear or the desire of something unobtainable.
“Eat your heart out” first emerged in English in the 1500’s in the latter sense, describing the emotional anguish suffered by someone.
Historically, it was also used as an insult with the hopes of inflicting some sort of emotional trauma to the recipient of the phrase.
Following the 1950’s, the expression started to be used in show business and stand-up comedy in a more ironic manner.
“Eat your heart out” became the ridiculing idiom, that is thrown around by many who are proud of their skills.