Raw materials
The part of IT (and electronics more generally) that is hidden are the raw materials used to actually make the components and process the printed circuit boards (sometimes known as printed wiring boards which is, technically, more accurate).
The most common parts (by a long way) are passives - resistors and capacitors. These are sold (typically) on reels of between 5000 and 25000.
Capacitors use different materials depending on type, but solid tantalum devices used Tantalum (a conflict mineral) which can be toxic. These devices have a habit of being pyrotechnically satisfying in some circumstances. Wet tantalum devices (still very much used) also use dilute sulphuric acid.
Surface mount ceramic parts use either calcium zirconate (class 1 devices) or barium titanate (class 2).
Surface mount resistors (by far the most common for at least the last 25 years) usually use either Nichrome (Nickel and Chromium alloy) for precision thin film parts and one of the oxides of ruthenium (most common), iridium and rhenium in thick film parts which are by far the most common ones in use today.
Most PCB materials are epoxies (some have the mechanical properties of epoxy but are based on other materials).
Other materials include Gallium Arsenide, Gallium Nitride (becoming extremely popular) and Gallium Aluminium Arsenide - the list is a very long one.
None of those materials is particularly rare, but they are all mined. If we could recycle the parts (they will usually last for decades) we could significantly reduce the amount of mining operations (Lithium mining is the elephant in the room of course).
IC packaging is commonly plastic encapsulated with copper lead frames and common pin finishes of tin or NiPdAu.
That is before we even get to the processing from raw materials to actual components; RuO2 resistors (as an example) are heated to 850C when they are being manufactured and that heat has to come from a source of energy somewhere.
Then we get to producing the actual PCBs with components. The most common process is reflow which uses copious amounts of nitrogen (which is inert and prevents certain solder defects) and water (used in post process aqueous cleaning along with various solvents). Modern lead free solders are mainly tin (SAC or SnAgCu is one type, Tin, Silver and copper) quite a bit of which is wasted. There is also the flux (essential for a good solder joint) which is usually a resin. Interestingly, the flux in lead free solders is far more aggressive than the flux used in tin lead solder as the soldering process takes a physically longer time.
That means that even if you can rework them, far better air extraction systems are required.
The interconnect is copper (with solder mask on most of it which is a polymer).
All this barely scratches the surface (no pun directly intended) but you get the idea. Unless all these inputs (including the processing) are considered we will not have a true idea of the overall environmental impact.
One more thing to consider; fabricating IC wafers uses an inordinate amount of water which has to be processed prior to use.
Now take all of those things that cannot be repaired (which are therefore replaced) and set the cost of those materials against the impact of slightly lower electrical efficiency if they could be repaired; it might make very interesting reading.
For this to happen though will require some form of incentive to the vendors of the items and I am not going to go there with this post.