Walls affect Wi-Fi because radio waves lose usable energy as they pass through building materials.
But not all walls affect Wi-Fi equally.
Drywall and dry wood are usually relatively minor obstacles.
Brick generally creates more noticeable attenuation.
Concrete can significantly weaken the signal.
Reinforced concrete adds the effects of embedded steel.
Large metal structures are often among the most difficult indoor barriers for wireless signals.
So if Wi-Fi behaves very differently from one room to another, do not look only at the number of walls.
Look at:
what the walls are made of, how thick they are, what is inside them, and what the complete signal path passes through.
That is the key to understanding how walls affect Wi-Fi signal strength and real-world performance.