@Tepichin I still remember when I took Old Testament at a school that taught this viewpoint and had to spend a few hours wrestling with the question of why Gen 1 and 2 are different. I was relieved to find the explanation is actually very simple.
The following article does a good job of addressing the differences between Gen 1 and 2 in light of the documentary hypothesis:
Here is a good summary quote from Edward J. Young used in the article:
There are different emphases in the two chapters…but the reason for these is obvious. Chapter 1 continues the narrative of creation until the climax, namely, man made in the image and likeness of God. To prepare the way for the account of the fall, chapter 2 gives certain added details about man’s original condition, which would have been incongruous and out of place in the grand, declarative march of chapter 1 (1960, p. 53).
Basically, Genesis 1 is the big picture while Genesis 2 zooms in to provide more detail about mankind and to provide the appropriate background for Genesis 3.
Regarding the original sources for Genesis and the documentary hypothesis (theory that there are multiple authors), the following resources provide some helpful thoughts to chew on. I personally think Moses may have had sources both oral and written passed down from Noah through Shem to Abraham and so on and that a few other authors - perhaps Joshua - added the bits about Moses’ death / did a bit of editing. The documentary hypothesis is speculation without any actual historical evidence to support the existence of multiple authors.