[W]e must clarify, to the best of our ability, why just in certain sections or verses the Torah narratives have the Tetragrammaton and in others ’Elohim. Is it possible to formulate rules with regard to the use of the Names in proximity to each other? I believe that we are able to answer this question affirmatively. On the basis of what we have stated so far, we may assume that in each case the Torah chose one of the two Names according to the context and intention, precisely as follows:
It selected the name YHWH when the text reflects the Israelite conception of God, which is embodied in the portrayal of YHWH and finds expression in the attributes traditionally ascribed to Him by Israel, particularly in His ethical character; it preferred the name ’Elohim when the passage implies the abstract idea of the Deity prevalent in the international circles of ‛wise men’—God conceived as the Creator of the physical universe, as the Ruler of nature, as the Source of life.
The Tetragrammaton is used, when expression is given to the direct, intuitive notion of God, which characterizes the simple faith of the multitude or the ardour of the prophetic spirit; the name ’Elohim, when the concept of thinkers who meditate on the lofty problems connected with the existence of the world and humanity is to be conveyed.
The name YHWH occurs when the context depicts the Divine attributes in relatively lucid and, as it were, palpable terms, a clear picture being conveyed; ’Elohim, when the portrayal is more general, superficial and hazy, leaving an impression of obscurity.
The Tetragrammaton is found when the Torah seeks to arouse in the soul of the reader or the listener the feeling of the sublimity of the Divine Presence in all its majesty and glory; the name ’Elohim, when it wishes to mention God in an ordinary manner, or when the expression or thought may not, out of reverence, be associated directly with the Holiest Name.
The name YHWH is employed when God is presented to us in His personal character and in direct relationship to people or nature; and ’Elohim, when the Deity is alluded to as a Transcendental Being who exists completely outside and above the physical universe.
The Tetragrammaton appears when the reference is to the God of Israel relative to His people or to their ancestors; ’Elohim, when He is spoken of in relation to one who is not a member of the Chosen People.
YHWH is mentioned when the theme concerns Israel’s tradition; and ’Elohim, when the subject-matter appertains to the universal tradition.
Rabbi Umberto Cassuto (1883 - 1951), The Documentary Hypothesis and the Composition of the Pentateuch, 30 - 32