A nomad was first of all a herder, and the word is about grass.
Etymonline dates nomad to the 1550s, when it meant a wanderer, one of a tribe with no fixed abode. Merriam-Webster gives 1579. English took it from French nomade in the 16th century. That came from Latin Nomas, genitive Nomadis, which Etymonline glosses as wandering groups in Arabia. Merriam-Webster describes the Latin as a name for pastoral peoples in places such as northern Africa or Scythia.
The Latin word came from Greek nomas, meaning roaming or wandering, and Merriam-Webster glosses it as "wanderer, shepherd." So the Greek idea was never aimless travel. The movement had a purpose, which was to find grazing.
The Greek word derives from nomos, "pasture" or "grazing," which Merriam-Webster traces to a verb meaning "to graze." Etymonline adds that nomos literally referred to land that had been allotted. Behind it sits a Proto-Indo-European root, *nem-, meaning to assign, allot or take. So at the deepest level the word is about dividing things up, and the pasture is what got divided.
That is a neat irony. A nomad is defined by lacking fixed land, yet the word comes from a root about land being apportioned. The wandering herder is the one who moves between allotments.
English added the adjective nomadic in 1800, according to Etymonline. The noun's meaning widened from herding peoples to anyone without a settled home. The pasture dropped out of the picture a long time ago.
Etymonline also says the name of the Numidians, who gave their name to the ancient North African kingdom of Numidia, is related to nomad. It does not lay out the link in detail, so treat it as a lead.