There is a general principle in this area. when electromagnetic wave is incident through an object, a portion of it is reflected back and the rest is penetrated through the object. now based on material(electrical) properties of the object the amount of reflection and penetration are different. for example in the case of metals almost all the incident waves are reflected and and that small amount which is penetrated, will be damped a little distance away inside the object.
you may refer to text books like Field and Wave Electromagnetics by David Cheng, or Advanced Engineering Electromagnetics by Constantine Balanis for detailed information.
Reflection, transmission and absorption of materials is related to their (complex) indices of refraction. In simple treatments you can use classical E&M and just compute which wavelengths make it through at which locations. refractiveindex.info is a good resource.
Diving deeper into the 'why' reveals that the band structure of a given material leads to optical transitions that may or may not exist for different wavelengths. If a given photon can excite an electron (or anything in that material) and lose its energy, its gone. The exact nature of why certain wavelengths go through and others don't is related specifically to the atomic structure of what you're studying.
This is why silver looks 'silver' and copper looks 'copper'. It has to do with the atoms they are composed of and how their orient themselves.