There are a few reason why it is not always accurate to describe the movement of electricity as "passing through" something.
First we need to remember that matter is made up of either conductors or non-conductors. Generally speaking, under normal conditions, electrical energy can be stored in a non-conductor but it is not possible to transfer the electric energy, or the "electricity", through the non-conductor. That is in fact what makes it a non-conductor.
For conductors, it is still not accurate to say the electricity travels through a substance. For metal conductors, the electrons that are the normal transports of electric charge, do not travel through the inside of the conductor. They travel exclusively along the outside.
Secondly, the actual individual electrons may not travel from one end of the conductor to the other at all. Electrons pass electrical energy which does the work of the electricity by creating an electric field which is proportional to the number of electrons being used. The electric field travels from one end of the conductor to the other and it is this energy which we measure as "electricity". Now, electrons DO move, but they move by displacing other electrons: in DC, one electron moves from the power supply into the conductor; the electric repulsion of like charges displaces an adjoining electron in the conductor; that electron then displaces the next, etc... until an electron at the other end "pops out". The electron which started the process may never actually pass all the way from one end of the conductor to the other. (In fact, in AC circuits the electrons oscillate back and forth and do not "move" from one end to the other at all.)
So, electrical energy may pass through a substance doing work as it goes, however the actually electric charges do not.