Answer: The preposition "por" can be used:
1. To indicate who or what performed an action in the passive voice.
2. To express the cause of something.
3. As a synomym of the preposition through.
Explanation: Just to elaborate a little on the answer, it can be added that the preposition "por" is highly versatile and it has many different meanings. You would use it, for instance, to say that "the dog was being washed by the girl (<em>el perro estaba siendo lavado por la niña</em>). Also to indicate that "the hotel is closed because of the holidays" (<em>El hotel está cerrado por vacaciones</em>). And, in addition, you could use "por" to indicate that "the thread went through (the eye of) the needle" (<em>el hilo pasó por el ojo de la aguja</em>).