According to the rules, it is not allowed to have wall areas of 2x2 or larger. Therefore certain squares cannot be part of a wall because that would create a forbidden wall area.
Here's an example:
The squares marked with red dots cannot be part of a wall as that would create a 2x2 wall area, which is forbidden. These squares must therefore belong to an island.