What is the difference between nautical air miles and nautical ground miles? What is a simple way to understand the difference between the nautical air mile (NAM) and the nautical ground mile (NGM)?
How does the wind affect the net displacement of the aircraft as that is the only differentiating factor between NGM and NAM? (NAM by definition does not include the vertical displacement or the altitude gained by the aircraft.)

For further reference to mathematical formulae defining the above terms:
https://www.theairlinepilots.com/forum/viewtopic.php?t=320
From my deep dive in the quest to unravel the mystery of NAM and NGM, with inspiration from the BELOW answers I'm able to conclude with a couple of points:

NAM and NGM are same if wind is still

NAM measurement is independent of the wind and depends solely on the movement of the aircraft relative to the air around it. NGM is a dependent quantity which solely depends on the wind ie. With a Headwind component NGM is lower than NAM and vice versa for tailwind condition.

The usage of NAM was most prevalent in older flight planning systems for long range cruise before the age of FMCs which do the same thing electronically, NAM provides a database of performance of an aircraft in various phases of flight independent of the wind, to which the wind correction maybe applied to determine the practical value.
A nautical ground mile is one nautical mile over the ground.  A nautical air mile is one nautical mile through the air mass.  This distance can be different because of wind.
For example:
If you are flying at 100 knots true airspeed in a zero wind condition, nautical ground miles will equal nautical air miles.
However, if you are flying at 100 knots true airspeed into a 100 knot headwind, your nautical ground miles will alway be zero, regardless of how many nautical air miles you fly for (at 100 knots).
Anything in between will result in some variance affecting the “net displacement of the aircraft”.  This variance can be calculated using the basic wind triangle.