Light is both an electromagnetic wave and a collection of photons travelling together. Photons are basically small packets of energy each color that compose the white light having a certain energy. When a medium absorbs light, one electron of one atom composing the medium jumps from one lower energy level to a higher energy level and a photon from the incoming light disappears. When a medium is transparent for visible light this only means that there are no energy levels in the atoms composing the medium for which their difference is equal to the energy on the incoming photons. However, outside the visible spectrum, light can be absorbed by the medium. Taking glass for example, the infrared portion of the spectrum (higher wavelengths and thus lower photon energy) is completely absorbed by it.
Every material is composed of arrangements of molecules and atoms. Depending on the arrangement, a certain amount of light is allowed to pass through. In the case of transparent materials, it is not that you can see through what the material is composed of. You must, instead, think of images as patterns of light that we can then interpret as visual information.