What is the significance of the numerical correspondence between the 42 camps or waypoints mentioned in the recounting of the forty years of wandering (Bamidbar 33) and the fact that 42 of the 48 Levite cities mentioned in the same parsha (Masei) are of the ordinary non-refuge kind (Bamidbar 35:6)?
R. Shlomo Kluger in his sefer Imrei Shefer here explains that the 42 cities that Yisrael gave to the Levites corresponded to the 42 journeys which Yisrael made in the wilderness and thus required 42 places of rest, each of which Hashem changed from being a very desolate place into a place to live. Therefore, Yisrael needed to repay this kindness to Hashem, and they did so by giving to the Levites who were servants of Hashem 42 cities in which to live since they had no land of their own, one city for every place that they had rested.
See Targum Yonasan (Devarim 6:10) who says that after Aharon died Amalek attacked. Some Jews ran back towards Mitzrayim by six journeys. The b'nei Levi chased them and fought with them. There were casualties on both sides and although the survivors returned, the b'nei Levi concluded that their losses were as a result of not mourning for Aharon properly. Here is the full text:
יונתן דברים פרק י
ו) וּבְנֵי יִשְׂרָאֵל נְטָלוּ מִן כּוּפְרָנֵי בֵּירֵי בְּנֵי יַעֲקָן לְמוֹסֵרָה תַּמָּן אַגַח עִמְהוֹן עֲמָלֵק כַּד מְלָךְ בַּעֲרָד דִּשְׁמַע דְּמִית אַהֲרֹן וְאִסְתַּלְקוּ עֲנָנֵי יְקָרָא וּמִדְעָקַת עַל יִשְׂרָאֵל עַל קְרָבָא הַהוּא בָּעוּ לְמֵיתוּב לְמִצְרַיִם וְהַדְרֵי שִׁית מַטְלִין רְדָפוּ בְּנֵי לֵוִי בַּתְרֵיהוֹן וּקְטָלוּ מִנְהוֹן תַּמְנֵי גְנִיסַן וַהֲדָרוּ לַאֲחוֹרֵיהוֹן אַף מִבְּנֵי לֵוִי אִתְקְטִילוּ אַרְבַּע גְּנִיסַן אָמְרוּ דֵין לְדֵין מַאן גָּרַם לָנָא קָטוֹלָא הָדָא אֶלָא עַל דְּאִתְרְשַׁלְנָא בְּמִסְפְּדָא דְאַהֲרֹן חֲסִידָא וּקְבָעוּ תַּמָּן מִסְפְּדָא כָּל בְּנֵי יִשְׂרָאֵל כְּאִלּוּ תַמָּן מִית אַהֲרֹן וְאִתְקְבַר תַּמָּן וּבְכֵן שַׁמֵּישׁ אֶלְעָזָר בְּרֵיהּ בְּאַתְרוֹי