Light is said to have dual nature ie both particle nature and wave nature. Some properties of light like photoelectric effect can be explained by particle nature while other properties like diffraction and interference can be explained by the wave nature of light.
Light passing through solid materials is an effect of the particle nature of light.
The phenomenon of light existing in two places at once is explained by quantum mechanics which is used to explain the wave nature of light.
The expanation given by these theories and the reason for the occurence of these phenomena are beyond the scope of your class. But you will learn in detail about this in classes 11 and 12.
Here, just understand that light has dual ie double nature. It is both a wave as well as a stream of particles.