Monster pathfinding: When picking a route, they look at everything between them and where they want to go. Every valid tile has a move cost, this includes ones they'd need to break something to get through, just higher cost, based on what they'd have to break. Roads are lowest cost, empty terrain is default, other things pathing through a tile slightly increase the pathing cost of that tile, walls increase it some, gate a bit, not as much as walls, water also increases it, as does tar (a ton), and forest/rock increase it a ton. Based on all this, a path is picked, and off the monster goes.
Thicker walls = less chance the monsters will decide to break through that section.