Signals have different frequencies and that makes them to have different sizes. Largest waves in size or wavelength are radio waves. Radio waves are the biggest can easily pass straight through the wall, because they are so large there the wall is almost invisible.
It is like a huge elephant that has no idea about a small ant standing right to its feet because the elephant is too big compared to ant.
Larger waves in length can pass walls because their size is larger than the wall atoms.
For example, imagine that you and mosquito are at a place, you both wanted to go home, but it is raining heavily. Now the rain is the barrier and you will be the larger wave. But the case is you can run fast to your home. Mosquito will take time as it is roughly same in size as one rain drop. We get to know that Wi-Fi signals can pass through the walls ultimately but not completely.
And that explains clearly why the Wi-Fi signal strength is excellent near the Wi-Fi and weaker when you are in the different room.
The analogy is you would reach your home but you will get wet at the end.
I hope, you all got an idea of how Wi-Fi signals penetrate walls.