What is the comparison to an apple tree among forest trees?
Shabbos 88a: Yisrael are compared to an apple tree. Just like its fruit precedes its leaves, Yisrael put Na'aseh before Nishma.
Rashi: When an apple tree is among barren trees, it is dearer than all of them, for its fruit has good taste and smell.
Rashi citing Midrash Agadah: All flee from an apple tree, for it has no shade - so all nations fled from Hashem at Matan Torah. However, "I desired His shade and dwelled with in it." Seforno - "v'Hem Tuku l'Raglecha" (Devarim 33:3).
Malbim (Melitzah): Hashem is the Nefesh of the worlds, for He conducts, moves and sustains them like the Nefesh moves, sustains and influences the body. The Zohar (Ha'azinu) says, just like an apple tree is distinguished via its colors among other trees of the field, so Hashem is distinguished over all legions above and below.
Among which sons is Dodi?
Rashi: The bachelors.
Rashi according to the metaphor: Hashem is chosen over all the gods - therefore, "I desired His shade and dwelled in it."
Malbim (Melitzah): Other conductors accompany Him, i.e. nature and enforcers of Shamayim and their powers that he apportioned to them, to the point that the influence of Hashgachah from Hashem is hidden and wrapped. It seems like an apple tree among forest trees. Due to [the latter's] height and many branches, they darken and cover the apple tree, which is shorter 1 . So the great Heavenly spheres and bodies that revolve and exercise power over the world, they are visible; the Divine Hashgachah is hidden. Sometimes Hashem conducts according to Hashgachah, and nullifies all natural forces. And sometimes conduct based on nature and laws and enforcers of Shamayim, it overpowers, and the supreme Beloved is hidden.
Malbim (Mashal): Even so, the apple tree is distinguished via its smell and sweet fruits.
Why does it say "I desired His shade and dwelled in it"?
Rashi: Refer to 2:3:2:2.
Malbim (Melitzah): Hashem conducts according to Hashgachah when Nefashos conduct their worlds (bodies) based on choice according to intellect. Then also the world and its natures are submissive to Hashem's intellect and there is miraculous conduct. Then Nefashos connect to Hashem's supreme Nefesh, and they see Divine visions and Nevi'im have Nevu'ah. This is the chariot that Yeshayah and Yechezkel saw, Nevi'im saw visions with Ru'ach Hashem of worlds, and the Unlimited rising over them with wondrous conduct; He fills all the worlds. Then the Nefesh desires His shade, for shade of forest trees is Batel. When Nefashos are drawn after nature and do not rule over their nature and Yetzers, nature rules over the world. Hashgachah is wrapped under the veil of nature and Mazal. Forest trees darken the apple tree via their branches and shade.
Malbim (Mashal): I desired to be under its shade due to the nice smell and sweet fruits. Sometimes she sits in its shade when she leaves Chadrei Shlomo and is isolated with [her beloved]. And sometimes when she is incarcerated under the shade of other trees, she eats the fruits of love, which are sweet to the palate.
What fruits is sweet to her palate?
Seforno: Divrei Torah - "v'Shamanu v'Asinu" (Devarim 5:24).
Malbim (Melitzah): The fruits of Hashgachah. They will be Kodesh fruits for weak Nefashos, for food and healing. They will understand His Torah, Mitzvos, ways and conduct, and learn Yir'as Hashem and Ahavas Hashem. They will eat from Pri Etz ha'Chayim, and live.
Malbim (Mashal): The fruits of love.