When Hashem appeared to Moshe and told him to begin his mission to prepare the way for Bnei Yisrael’s liberation, Moshe asked what proof he would have that Hashem had appeared to him. Hashem involved Moshe in a miracle he could carry out for Bnei Yisrael so that they would believe him. He told Moshe to take his staff and throw it to the ground, whereupon it turned into a snake (Shemot 4:3). Moshe ran away in fear because he thought that the snake, which represents evil, was independent. The fact that he was able to turn the staff into a snake and then back into a staff proved that Hashem controlled even that which we see as bad in the world. This miracle also convinced the nation that Moshe could lead the nation to liberation (ibid. 30-31).
In our parasha (ibid. 7:9-10), Moshe and Aharon were told to perform the miracle of the staff before Pharaoh as well. They did so, and the Torah said that the staff turned into a tannin. This overlapping of stories indicates a connection between the snake and the tannin, one that exists in several places in Tanach. (A tannin can mean a snake, or it can mean an alligator, or, in some contexts, it can refer to a whale).
One such occurrence is in the story of creation, where it says that Hashem created the big tanninim (Bereishit 1:21). Rashi picks up on a missing letter in tanninim and says that it is referring to the Leviatan. The issue is that would it have reproduced, it would have destroyed the world, and, therefore, Hashem took away the female. Thus, the forces of evil and destruction, which are called tanninim in the first biblical narrative, find expression as the snake in the story of Adam and Chava.
The question that has troubled man from time immemorial is: who rules over evil in the world. Bnei Yisrael went into exile, specifically to Egypt, the society which reached the 49th level of impurity, and being in the "house of slavery," they were in the most vulnerable place within it. Our liberation from the house of slavery in Egypt shows that Hashem is everywhere, and no evil can keep Him out. Even Pharaoh, who thought he was an unstoppable leader, was far from that. In fact, the tannin represents Pharaoh metaphorically, as Yechezkel (29:3-4) says: "So says Hashem: I am upon you, Pharaoh the King of Egypt, the great tanim who lies within his rivers and says: ‘The rivers are mine and I made myself.’"
Turning the staff into a snake and back convinced Bnei Yisrael that there is an ultimate power in the world, a power which Pharaoh cannot overcome. To convince Pharaoh of the same, much more work was needed, as he was not ready to admit any limitations to his power. Only after a long process, ending with the Exodus and, soon thereafter, the splitting of the sea, was the stubborn leader left with no choice in the matter.