^Exactly what Andrews said.
WiFi is not the best thing to begin with but a lot of things can make it worse. Too many WiFi Router or Access-points on the same channel start canceling each other out. Each wall in between you and your router reduces the signal strength additionally. WiFi-Signals don't follow the hallway and walk around corners.
Think of it like a light bulb, the light spreads out, but every object in between you and the bulb casts a shadow. While it might still be bright behind it, the light intensity is reduced. More objects casting a shadow in a row means even less strength. All you need then is one interference and you connection drops for a short duration until everything is capable of reconnecting.