by Reb Dov bar Leib @ Mystical Paths
Moshiach ben Dovid’s yichus (familial relationship) is always patrilineal. This is not so with Moshiach ben Yosef. We see this from Yehoshua bin Nun (biblical Joshua) himself and with all the b'nai Rachel (sons of biblical Rachel) in general.
I believe that Yehoshua bin Nun had only daughters. So if Moshiach ben Yosef has to come from Yehoshua of Ephraim, he has to come from his daughters. We also learn about the laws of the inheritance of women from daughters of Tzelafchad via the other son of Yosef (biblical Joseph), Menashe.
Finally we see with Dariyavush that his Meshichut to complete the 2nd Temple came from his mother Esther of (the tribe of) Binyamin (Benjamin), not from his evil father. So kingship and inheritance for the Bnai and Bnot Rachel (sons and daughters of Rachel, wife of Joseph) is sometimes matrilineal and therefore harder to trace.
This in not a problem for the Bnai Leah (children of Leah, wife of Joseph) whose king, Yehudah, that came from her passes on his malkhut (kingship) patrilineally.
This could possibly explain Netanyahu's (Israel’s current prime minister) problem. The Yud Key Vav is in his last name, not his first name. (The name Netanyahu in Hebrew contains 3 consecutive letters of G-d’s 4 letter name.) So the Yosef part of his personality comes from his father, not his mother. Even if his father patrilineally is a Levi and his father's mother is from Ephraim.
Finally for those who want to look into this as a kabbalistic matter, Amalek is the principal representative in the world of the masculine aspect of the yetzer hara (evil inclination). We know this because for Amalek we say zachor - which can mean Remember but can also mean male.
Amalek can only be defeated in the world by the feminine aspect of the yetzer hatov, the children of Rachel and her descendants. The masculine aspect of the yetzer hatov are from the children of Leah. And they can defeat the feminine aspect of the yetzer hara. This is why Shimon and Levi before destroying Shechem had to weaken the men by getting them to do brit milah (circumcision) before they destroyed the city when the men were sick on the third day after the circumcision. Shimon and Levi are bnai Leah.
Personality wise, Yosef was a bit effeminate, for he was constantly working on his appearance. This was not the case with Yehudah. Yosef and Binyamin both were strong in the visual arts and are still so today with an inordinate number of Chabadnicks, the bnei Ephraim of this generation, very strong in the visual arts.
On the other hand the Bnei Leah are very strong in the musical arts as we see with King David himself who was a master on the harp. And of course there was the great Levitical choir in the Temple itself!