The history of ancient Egypt is generally divided into five major periods:

During the first four phases, the rulers of Egypt were called “kings”.

It was only from the New Kingdom onwards that the title of “pharaoh” began to be used to designate the sovereign, whereas previously it was a word used to designate the palace.

This information became accessible thanks to the Rosetta Stone:

Rosetta Stone © Hans Hillewaert, license CC BY-SA 4.0
This stone block engraved in three scripts allowed, in 1822, the decipherment of hieroglyphics.
Now, here is what the religious texts say.
Both the Bible and the Quran speak of two great prophets sent to Egypt:
Thanks to the decipherment of hieroglyphics, particularly via the Rosetta Stone, historians were able to better reconstruct the periods of ancient Egypt.

Historians place each narrative in a distinct period of ancient Egypt:
The Bible uses the word “pharaoh”, whether for Joseph or for Moses.

But the Quran makes a perfect distinction consistent with real history: