Hyksos
At the end of the 12th dynasty a people called "Hyksos" settled down in the eastern delta. After a presence in the country for about 150 years another hyksos dynasty (15) made a fortified capital of Avaris.
The Hyksos were foreign invaders who overran Egypt in the 17th century BC and established two contemporaneous dynasties. The 15th dynasty (1674-1567 BC) of the great Hyksos kings dominated the Hyksos vassal chiefs of the 16th dynasty (1684-1567 BC). Egyptians called these kings "rulers of foreign lands," translated in Egyptian as "hega-khase". Greek authors later rendered this as "Hyksos," which was mistranslated as "shepherd kings." For this reason many scholars believed the Hyksos to be the Hebrews, although there is no archaeological basis for this assumption. They were probably city dwellers from southern Canaan (later called Palestine by the Romans).
The period of their rule was a time of peace and prosperity for Egypt. They respected the native religions, maintained ancient Egyptian as the official language of the government, and allowed many Egyptians to serve in the high levels of the administration of the state. They taught the Egyptians new military techniques and introduced the use of the horse and chariot.
The Hyksos were unable to quell the feelings of Egyptian nationalism. They held the southern lands in check with an alliance with the Nubian kingdom of Cush. Despite this, the southern Egyptian city of Thebes finally began a war of independence that culminated with the expulsion of the Hyksos by Ahmose I in 1567 BC.
The rather peaceful dynasty 14 was hereby ended (like the Egyptian dynasty 13) and the new rulers of Avaris (possibly a new wave coming from the Palestinian region) were acting in a more expansive and military active way. They had their own gods but never imposed these on the indigenous people and the language in the administration continued to be Egyptian. They only one domestic god they worshipped was - Set, who they identified as their own god of storms. They seem to have adopted Egyptian manners, laws, and had trade relations with the Minoans and Babylonians. They were recognized by later Egyptians and listed as legitimate kings, but no tombs from these half a dozen rulers have been found and their personal names were non-Egyptian.
The kings claimed themselves pharaohs with all the regalia and tradition attached to that title and the more than hundred years they ruled northern Egypt was mainly a time of peace and prosperity.
A big advantage in combat was their introduction of horses (a new animal to the Egyptians), previously unknown elements in the Egyptian army and they also introduced improved weapons. At most they had control down to the middle Egyptian town of Hermopolis and thus divided the Nile Valley into two parts with the Egyptian dynasties 16 and 17 ruling the south.
No hostility seems to have been between the two parts until the last 20 years after a century of relatively peace. The 16th dynasty (possibly from the Abydos region) may by time have been vassals to the 15th and then were taken over by the 17th from Thebes. From there came the liberation war, initiated by Amhose I and completed by Thutmoses III, that finally wiped out the Hyksos dynasty.
these Kings are foreigners, true they claimed the titles, but the title only applied to the native Kings. Joseph was in that period.
Joseph, Egypt and the Hyksos...
Do you see this statement in the text above "Egyptians called these kings "rulers of foreign lands". not Pharoah.