I will skip the pre-history of solving polynomial equations and factoring polynomials. Let me mention that the analogy between long division of numbers and polynomials goes back to medieval Islamic mathematician al-Samawal, see Who invented short and long division?, and the Euclidean algorithm for polynomials was optimized by Hudde, a younger contemporary of Descartes, see Suzuki, The Lost Calculus.
The history proper of irreducibles starts with cyclotomic polynomials in Gauss's Disquisitiones Arithmeticae (1801). His motivation was related to inscribing regular polygons into a circle with straightedge and compass, and a cryptic remark pointed to a generalization to the lemniscate. The early theory was developed in the context of "higher congruences", polynomial equations modulo primes and their powers, see Cox's Why Eisenstein Proved the
Eisenstein Criterion and Dickson's History of the theory of numbers, ch. VIII. The study of general number rings by Kummer and Dedekind came from the same source.
Gauss proved that cyclotomic polynomials with prime indices are irreducible (he did not use such terminology). In the course of it he proved the first general result on irreducibility, the Gauss's lemma. Even more relevant was the unpublished section 8 of Disquisitiones Arithmeticae, titled Disquisitiones generales de congruentiis, where Gauss studied "polynomial congruences" modulo $p$, i.e. polynomials in $\mathbb{F}_p[x]$ in modern terms, see Frei, The Unpublished Section Eight. He counted the number of irreducible monic polynomials in $\mathbb{F}_p[x]$, and proved a case of Hensel's lemma in the course of it. But all of this only became available after Dedekind published section 8 in 1863 (full version in 1876), and was rediscovered by others in the meantime, especially Schönemann and Dedekind himself.
But even the published parts were inspiration enough for Abel and Galois. Abel's irreducibility theorem, not so formulated, appeared in his Mémoire sur une classe particulière d'équations résolubles algébriquement (1829). Abel was led to it by his earlier extension to the lemniscate of Gauss's result on subdividing a circle into equal parts, per Gauss's remark. In Galois' note Sur la theorie des nombres (1830, it appears with English translation in The mathematical writings of Évariste Galois) we see the term "irréductible", although it is applied to congruences rather than polynomials, and a related construction of finite fields.
But Schönemann in a two part paper Grundzuge einer allgemeinen Theorie der hohern Congruenzen (1845) and Von denjenigen Moduln, welche
Potenzen von Primzahlen sind (1846) independently rediscovered both Gauss's and Galois' results and went much further. In particular, he applies "irreducible" to polynomials, and states a general problem:"To investigate, whether the power of an irreducible polynomial modulo
$p$ is or is not irreducible modulo $p^m$", which he solves using a version of what is now called the "Eisenstein criterion" of irreducibility (largely due to van der Waerden's oversight). Eisenstein rediscovered the criterion when reproving Abel's theorem on subdividing the lemniscate, and shared the idea in a letter to Gauss in 1847, but the published version only appeared in Uber die Irreductibilitat und einige andere Eigenschaften der Gleichung (1850). A number of authors worked on higher congruences from that point on, Mathieau, Serret, Dedekind, Kronecker, Jordan, Weber, etc.
In the hands of Dedekind, after his Abriß einer Theorie der hoheren Kongruenzen in bezug auf einen reellen Primzahl-Modulus (1857), the story took a more abstract turn that led to modern ring theory. Later Dedekind synthesized the work of Gauss, Galois, Schönemann and Kummer by introducing rings and ideals, and developing unified terminology of primes and irreducibles, see What changes in mathematics resulted in the change of the definition of primes and exclusion of 1? In a more concrete vein, Kronecker gave a general algorithm for completely factoring
a rational integer polynomial into a product of irreducibles
in 1882, see Dorwart, Irreducibility of Polynomials. The Schönemann-Eisenstein criterion was extended by Konigsberger (1895), Netto (1896) Bauer and Perron (1905). Dumas developed the now popular Newton polygon method to study irreducibility in Sur quelques cas d’irreductibilite des polynomes a coefficients rationnels (1906), see Schönemann-Eisenstein-Dumas-type irreducibility conditions by Bonciocat.