I am an inner city high school history teacher, and we are currently covering the three major 2nd Millennium Islamic Empires. I always like to give my kids visual aids, like flags.
The flags of both the Mughal Empire and the Safavid Dynasty feature a leftward facing lion in front of a sunburst on a green background. The resemblance is way to uncanny to be a coincidence. What gives?
With regards to Iran, you can find a great article about historical Persian flags on the Encyclopaedia Iranica website. To summarize, the Lion and Sun symbol has a rather long history. Both the Sun and Golden Lion are symbols of kingship and royalty and were in use from ancient times, as reliefs carved into various temples and palaces attest. A Golden Lion is also the emblem of the house of Godarz, a character in the Shahnameh, an extremely influential epic poem and the national epic of Persia.
From the Encyclopaedia:
The sun (imagined as a male) had always been associated with Persian royalty: “a crystal image of the sun” identified the royal tent of Darius III (Quintus Curtius, 3.3, 8); the Arsacid banner was adorned with the figure of the sun (Tertullian, Apologeticum 16); Sasanian crowns were surmounted by a ball symbolizing the sun. Malalas (18.44) quotes the salutation of a letter from the “Persian king, the Sun of the East,” to the “Roman Caesar, the Moon of the West” and the Šāh-nāma (Moscow, V, p. 90, vv. 76f.) quotes the Turanian/Turkish hero-king Afrāsīāb (q.v.) as saying: “I have heard from wise men that when the Moon of the Turks rises up it will be harmed by the Sun of the Iranians (ke čōn māh-e Torkān barāyad boland, ze ḵoršīd-e Īrān-š āyad gazand).
The Lion was also a very common symbol of royalty in the ancient and medieval world. Lion hunting scenes are somewhat common in Assyrian reliefs, showing the power of the Assyrian kings over nature. Persia was no different, and neither were the neighboring areas:
Islamic, Turkish, and Mongol traditions also stressed the symbolic association of the lion and royalty (Grünert; Kindermann; Ackerman; Köprülü; Spuler, Mongolen4, pp. 282 f.). They likewise reaffirmed the charismatic power of the sun (Milstein), and the Mongols re-introduced the veneration of the sun especially in its rising phase (Spuler, Mongolen4, pp. 140 f.). As a result of these developments the heraldic use of the lion and sun symbol gained popularity and was extended, appearing on banners (literary evidence in Mīnovī, p. 97) as well as on coins and textiles, metalwork, and luster tiles (Nafīsī, 1949, pp. 54-60).
Also:
Clavijo (pp. 207 f.) describes a palace which Tīmūr had seized from the former Chaghatay khans of Samarqand, and states that the lion and sun symbol ornamented the gateway of the main building and the arches around the courtyard. He was told (ibid, p. 208) that this emblem “was the armorial bearing of the former lords of Samarqand.”
By the time of the Safavids (at least Shah Abbas), the symbolism of the Lion and Sun was ubiquitous, and eventually was adopted as the symbol of Persia. It also had Shi'a implications, given that Ali ibn Abi Talib was known as Asadullah (أسد الله), the Lion of God, and the sun symbolizing God's glory.
As to the Mughals, they were a very heavily Persianized dynasty to begin with, to the extent that Farsi was the courtly language before the development of Urdu, which is a highly Persianized form of Hindustani. Also, during the initial political instability in the Mughal Empire, the second Mughal Emperor Humayun was given shelter in Persia during his exile before being restored to the throne. There were also many Persian officials in Mughal courts. The reasoning for adopting the Sun and Lion as a Mughal symbol is largely the same - both the Lion and Sun being symbols of royalty.