In order to understand metta, one first has to understand "ill-will" (vyāpāda), origination of ill-will, and cessation of ill-will.
In order to understand origination and cessation of ill-will, one needs to understand Dependent Co-Arising.
Our image of the world and our image of ourselves are mirror reflections of each other. The two sides are reflections of each other because each side co-evolves by contrasting its identity with the other side.
Because of this, "ill-will" (=negativity) towards an aspect of the world we see as wrong and frustrating is always connected with attachment to some sort of idea of "good" we identify with. In simple words, "in this regard, they are bad and I'm good" or "they are wrong and I'm right". Similarly, "ill-will" towards oneself always comes with some sort of comparison: "in this regard, they are good and I'm bad" or craving: "they achieved this and I did not".
In practice, almost every person usually has a mix of many such points, some of which are
(self)[+]<===>[-](world)
and some are (self)[-]<===>[+](world)
. As our attention switches between these different points during the day, our sense of self and the world may flip many times between positive and negative. One moment you think you're messed up and the world is fine, and the other moment you feel the world is messed up and you're fine. Or, if you are very attentive, you can even notice two opposite points in your mind at the same time, making the lives of others pitiful and enviable at the same time, and making your self be an unrecognized genius and a complete loser at the same time. I'm exaggerating to make a point, but you get the idea. If you judge others, you judge yourself. If you judge yourself - you judge others. These judgements are relative to each other, therefore are always connected.
To boil all this down to a simple rule, if you hate the world you hate yourself. If you hate yourself you hate the world. The good news is, because the two sides are connected, healing one will always heal the other. So, if you learn to accept yourself, you'll learn to accept the world. If you learn to love the world, you will learn to love yourself.
And this, my friend, is the whole idea of Metta!
As my teacher explained, cultivation of Metta starts by cultivating acceptance of oneself with all your imperfections. Once you learn to not judge yourself, once you learn to "love" (accept) yourself unconditionally and to be your true self in front of the others without fear of judgement, just as you are -- then you will notice an immediate relief in your relationships with the world and with other people. Then, the next step, learning to "love" (accept) others without judgement will come easily and naturally. But you can also approach it from the other side: if you learn to accept others without judgement, you will eventually learn to accept yourself and be free.
Freedom is only possible when we are free from fear, including the fear of judgement, constraining our spontaneous expression of our inner goodness.
By now you should get a pretty clear idea that Metta is not "Wishing others to be happy". Metta (or Maitri in Sanskrit) is unconditional acceptance of someone just as they are, without judgement or hostility.
When you have metta towards someone imperfect (including yourself, or even towards the entire society), you don't pretend that they are perfect. Instead, you accept them with all their problems and wounds, like you would accept your own children. When you have metta towards someone difficult, you don't see them as inherently "bad" - but you do appreciate that some of their past karma, or karma of their family or social group, might have created causes for aggression and hostility, or lack of education, or bad taste for simple pleasures, or a confused system of values and ideals - so you do see everything as is, with all the causes and results of the causes and how these results limit the future possibilities, but you no longer impute an inherent qualitative characteristic to it.
(This idea of not judging, and not reifying your judgements as if they were inherent characteristics of other people, eventually builds up to realization of Emptiness, the insight into how our mind constructs its experience.)
The end goal of Metta is a state when you fully accept yourself and the world, so you feel "like a fish in the water". Meaning, when you are without judgement, you can be friendly and spontaneous without being on the defense. It's almost like the boundary between yourself and the world disappears. In a way you feel like a child, completely comfortable in your own realm.
With Metta, you don't need to try hard to look perfect, educated, strong, consistent etc. - because you accept yourself as you are and you're not afraid of judgement of others (because that judgement used to be your own projection to begin with). Similarly, your experience of the world is no longer negative - because the attachments that held your attention fixed on the judgements that colored the world in the negative colors - are gone too. You are perfect and the world is perfect, with all their imperfections, just as they are. This is Metta as it is understood in my tradition (the Maitreya tradition).