At first Auschwitz I was a camp for the Poles. In October of 1941 Auschwitz-Birkenau (Auschwitz II) began to be built as a camp for the Soviet POWs.
Already before various mass exterminations the Nazis were trying to deal with the presence of the disabled inmates. E. g. in the summer of 1941 they transferred several hundred disabled inmates to Sonnenstein, an euthanasia center with a gas chamber.
Meanwhile, groups of Soviet POWs that had to be executed (such executions were usually taking place in nearest concentration camps) were being sent to Auschwitz, where they were supposed to be shot.
The confluence of these events in the autumn of 1941 gave rise to an idea (according to the commandant Rudolf Höß it was the SS-man Karl Fritzsch's idea) to arrange gassings inside the camp in order to deal both with the euthanasia and with the mass executions.
The first gassing in the cellar of block 11 in the main camp took place on the 5th Sep. 1941 (not the 3rd, as sometimes claimed; source: Stanisław Kłodziński, "Pierwsze zagazowanie więźniów i jeńców w obozie oświęcimskim", Przegłąd Lekarski, no. 1/1972). Several hundred Soviet POWs and sick Poles were gassed. The process was extremely clunky, but the possibilities were staggering.
The Nazis decided to use the morgue of the crematorium of the main Auschwitz camp as a provisional gas chamber (several holes were made in the roof for Zyklon B introduction and presumably the doors were made gas-tight). Again, several hundred Soviet POWs were gassed and this operation was far more successful.
So at this point Auschwitz has not yet become the center for the "Final Solution of the Jewish Question", but a method of mass extermination had already been tested here.
Sometime in late 1941 Hitler made the decision-in-principle to exterminate the European Jews (on this see C. Browning, The Origins of the Final Solution; C. Gerlach, The Extermination of the European Jews). The logistical side took some preparations, but in 1942 various extermination camps started operations, including Treblinka, Belzec and Sobibor (Chelmno/Kulmhof began its operations even earlier, in 1941). They were far away from the "Old Reich", for the average German had to think that the Jews were merely deported somewhere to the occupied Soviet territories and made to work.
According to Höß, he was given an order by Himmler to use the camp Birkenau for the implementation of the "Final Solution". The exact details of how it happened are not clear (Höß' statements on this are confused and get the chronology wrong and likely distort things), but it must have happened in 1942, and from the subsequent evidence it is clear that Höß implemented Himmler's order. It must have been easy, exactly because the gassings have already been tried out. Höß only needed to find suitable buildings. The small gas chamber of the crematorium in the main camp, with its poor logistics, wouldn't have been able to serve as a mass extermination center for a prolonged period of time, plus it was too visible.
Eventually two peasant houses just outside of Birkenau were converted into gas chambers in the spring-summer of 1942 and the wholesale murder of the Jews unable to work that arrived to Auschwitz from all around Europe could begin. Later the morgues of the planned Birkenau crematoria 2&3, which at first were not planned as gas chambers, were re-purposed for the killings, and the crematoria 4&5 were planned with the gas chambers from the start.
The process of the extermination was intimately connected to slave labor. For it was the Jewish deportees unable to work who were murdered. The Jews able to work were spared death (until they, of course, eventually became unable to work too...) and either worked in Auschwitz (incl. Birkenau and e. g. Monowitz (Auschwitz III)) or were transferred to other slave labor camps.
Thus Auschwitz was an unsurprising choice as a clandestine deportation destination/sorting point for slave labor/slave labor camp/extermination camp.
As a further source, I recommend Prof. Robert Jan van Pelt's report on Auschwitz and Holocaust denial, in which he also tackles the complex history of Auschwitz: https://www.hdot.org/vanpelt/