Did it "belong" to another people before he was adopted by Hebrews? Is there any anthropological reconstruction about all this monotheistic thing?
Early Israelite religion was not monotheistic, and it remained in that classification for at least several hundred years. YHWH was developed very slowly in a syncretistic process were he was ascribed with all the attributes of the other deities in the region. This process of accumulation of powers and status reached a first high point during the archaeologically uncertain period of of establishing the monarchies when YHWH became not the sole but the high god in the pantheon and started to become the only God at the start of the Persian period.
Since he (male, since he became a divorcee from the female Ashera in the process) had been made by ascribing him with all the aspects of all the other gods it might be argued that he is identical to all of them being an all-encompassing superset of all deities available. Albeit since his divorce getting more and more grumpy with time.
While the exact etymology and geographic origin of the name might not be reconstructed with reasonable certainty, the apparent process of localised ethnogenesis of the Canaaanites-becoming-Israelites points into the direction of an increasingly abstracted, generalised and radicalised deity that is firmly rooted in West-semitic tradition. Initially just one of the deities, probably identical to the more widespread presence of El, his earliest attributes would be those of El.
Since the process of accumulation started it seems to have become practical or even necessary to separate this El from all the other Els around. Both to avoid confusion and to mark the ethnic boundary between worshippers.
“Early Israelite culture cannot be separated easily from the culture of “Canaan.” The highlands of Israel in the Iron Age (ca. 1200-587) reflect continuity with the “Canaanite” (or better, West Semitic) culture during the preceding period both in the highlands and in the contemporary cities on the coast and in the valleys. This continuity is reflected in scripts, for one example. Both linear and cuneiform alphabetic scripts are attested in inscriptions in the highlands as well as in the valleys and on the coast during both the Late Bronze (ca. 1550-1200) and Iron I (ca. 1200-1000) periods.”
The original god of Israel was El. This reconstruction may be inferred from two pieces of information. First, the name of Israel is not a Yahwistic name with the divine element of Yahweh, but an El name, with the element, *’ēl. This fact would suggest that El was the original chief god of the group named Israel. Second, Genesis 49:24-25 presents a series of El epithets separate from the mention of Yahweh in verse 18 (discussed in section 3 below). Yet early on, Yahweh is understood as Israel’s god in distinction to El. Deuteronomy 32:8-9 casts Yahweh in the role of one of the sons of El, here called ‘elyôn:
When the Most High (‘elyôn) gave to the nations their inheritance, when he separated humanity, he fixed the boundaries of the peoples according to the number of divine beings. For Yahweh’s portion is his people, Jacob his allotted heritage.
This passage presents an order in which each deity received its own nation. Israel was the nation that Yahweh received. It also suggests that Yahweh, originally a warrior-god from Sinai/Paran/Edom/Teiman, was known separately from El at an early point in early Israel. Perhaps due to trade with Edom/Midian, Yahweh entered secondarily into the Israelite highland religion. Passages such as Deuteronomy 32:8-9 suggest a literary vestige of the initial assimilation of Yahweh, the southern warrior-god, into the larger highland pantheism, headed by El; other texts point to Asherah (El’s consort) and to Baal and other deities as members of this pantheon. In time, El and Yahweh were identified, while Yahweh and Baal co-existed and later competed as warrior-gods. As the following chapter (section 2) suggests, one element in this competition involved Yahweh’s assimilation of language and motifs originally associated with Baal. One indication that Yahweh and El were identified at an early stage is that there are no biblical polemics against El. At an early point, Israelite tradition identified El with Yahweh or presupposed this equation. It is for this reason that the Hebrew Bible so rarely distinguishes between El and Yahweh. The development of the name El (’ēl) into a generic noun meaning “god” also was compatible with the loss of El’s distinct character in Israelite religious texts. One biblical text exhibits the assimilation of the meaning of the word ’ēl quite strongly, namely Joshua 22:22 (cf. Pss. 10:12; 50:1):
el elohim yhwh – God of Gods is Yahweh
Excerpt From: Smith, Mark S. “The Early History of God: Yahweh and the Other Deities in Ancient Israel (Biblical Resource Series).”, William B Eerdmanns: Grand Rapids, Cambridge, 22002.
That passage in Joshua is rendered "El, God, the LORD!" (NET), "he LORD God of gods"(KJV), "ο θεος θεος εστιν κυριος" (LXX), "fortissimus Deus Dominus" (Vulgate) for comparison, that is if you do not recognise this passage from your translation..
A different account:
We cannot therefore definitively exclude a link between Yw in the Ugaritic text and Yhwh, which would suggest that in the thirteenth or twelfth centuries Yhwh might have been known in Ugarit and (marginally) integrated into the Ugaritic pantheon. […]
An Egyptian text from the eighteenth dynasty that lists the places occupied by the Shasu nomads (who have already been discussed) mentions a “country of the Shasu and of Laban.” So there seems to be a connection between these nomads and “Laban,” which in this context functions as a geographic term. Is it, then, possible to connect Yhwh and this foreign god? This deity is represented in the papyrus as particularly violent and is identified using the terms Egyptians used for designating the god Babi/Baba (an ape god). Babi, however, was a form of Seth and then finally of the god Thot. It is hard to decide whether this violent deity without a name might possibly be Yhwh, but it is interesting to note the connection made in this document between Laban and Edom, a connection that is also made in the biblical story of Jacob (Israel), who is the brother of Esau (Edom) and the nephew of Laban.
These possible links between Seth and Yhwh all converge in a way that underlines the “southern” origin of Yhwh, his status as a warrior god, and his provenance from the steppes.
These texts from the book of Exodus may preserve the memory traces of a ritual by which a group of Shasu/Hapiru constituted itself via a mediator as ̒am Yhwh, the people of a warrior god to whom they attributed their victory over Egypt. This group then introduced the deity Yhwh into the territory of Benjamin and Ephraim, where Israel was located. An allusion to this encounter can perhaps be found in the poem of Deuteronomy 33:2–5: “Yhwh came from Sinai; he shone forth from Seir, he was resplendent from Mount of Paran … Indeed, he loves his people (̒am) … He became king in Yeshurun when the chiefs of the people assembled together with the tribes of Israel.” This last verse seems to indicate a kind of union between the chiefs of the ̒am Yhwh and the tribes grouped together under the name “Israel.” The chiefs of the ̒am Yhwh meet with the tribes of Israel and Yhwh thus becomes the god of Israel. Can we detect in this passage a trace of the installation of Yhwh as the premier god of Israel?
This ascendency seems to have occurred at the beginning of the Israelite monarchy—at the turn from the second to the first millennium— and this is how Yhwh became the tutelary god of Saul and David, who introduced him into Jerusalem.
From Thomas Römer: "The Invention of God", Harvard University Press: Cambridge, London, 2015.
Nobody really knows for sure. El/Elohim (which by the time of the writing of most of the Hebrew scriptures had become synonymous) has ancient Semitic roots, but Yahweh appears to be (nearly) unique to the Hebrews.
There is almost no agreement on the origins and meaning of Yahweh's name. It is not attested other than among the Israelites, and seems not to have any reasonable etymology. Exodus 3:14 (Ehyeh ašer ehyeh, or "I Am that I Am"), has not found favour among scholars and has been viewed as a late theological gloss invented after the true meaning of Yahweh's had been lost
In Joshua and Judges he does seem to be employed as a war god, with no central shrine.
There is one intriguing theory I'll mention: the Kenite Hypothesis. The earliest references to YHWH* we have come from Egyptian sources, and place his worshipers in the northern part of Arabia. The ancestors of the Hebrews were not living there (despite what Exodus may imply). So the idea is that YHW was borrowed from those people, perhaps through trading links. There are some interesting mentions of Midians and Edomites in the Hebrew writings, most notably including Moses' father-in-law in Exodus. But again, there is no universally accepted theory. This is just the best of a bad lot.
* - Semitic languages tend to be written in Alphabets that contain no vowel glyphs, since their vowels are generally predictable.
Some people associate Yah- with the Akkadian God Ea, which is Enki in Sumerian. Enki's cult belongs to the oldest city, Eridu. The temple, in the same location, is present in the oldest layers of the city (4,500 B.C.). It appears that the temple was originally dedicated to a non-anthropomorphic god, Abzu, the watery deep. Later, anthropomorphic deities emerged. It's thought that he was originally subservient to the godess Ninhursag.
The original pool of water (Abzu) remained in front of the temple. This later became common for Mesopotamian temples. It might be the origin of holy water and baptisms. There wasn't much else in common with Yahweh, but were talking about 1,500 years between them. The cult worshipped fishes and had fish feasts. They've left a lot of fish bones behind. Enki had a major position in Sumer as the father of Inanna (Ishtar). Enki appears to have a supportive role in the creation myths of Babylon and Marduk.
Israelites are believed to have received Yahweh from Midianites, caravan traders around the Red Sea.