Ok, this stuff isn't that easy. For me the understanding came only with implementation.
Assume you already have routines to clip a convex polygon with a infinite line (described in the book i've linked above).
The math here is not hard, but you need to handle numerical precission issues well to make it robust.
The hard thing is understanding the BSP and its power.
I made this picture to explain the algorithm:
First, the BSP generation (1 & 2):
We begin with a bounding rectangle of the entire scene, link all walls to its interior list and now we want to pick our first split to bild the BSP.
We can choose any wall segment for the splitting plane (i use the term plane from 3D because it;s more common than 2D splitting line).
So we test them all and make our decission based on a heuristic: We want to avoid splitting many line segment, we want equal numbers of walls on each side, we want equal area of space on each side. (Thats the reason why building BSPs is slow)
Notice wall 1 and 2 share the same plane, and i have chosen that plane for the first split into blue and red 'floor polygons' or 'subspaces' or 'child nodes' - however we call it. We link both walls to the edge lists of each the red and blue polygons.
Also note the 3rd. wall gets split into two segments by doing so, so we link each segment to the corresponding polygons interior list and continue recursively.
In the next iteration each node has only one interior wall segment, so we use it for the plitting plane, divide space again and lik wall segments to edge lists.
All interior lists are empty now we're done building the BSP.
Second: Clip a arbitary convex polygon through the BSP and do additional visibility clipping from a given eye point (A & B)
We choose a white square to define maximum sight for the eye point (we could also use scene bounding rect for unlimited visiblity range). The process follows the same order we have build the tree.
So our first BSP split (red / blue) cuts the square into two pieces.
The red side is the same as the eye, so no further work necessary, just clip that piece with the red side child BSP recursively: No further intersection, done.
The blue side is other than the eye, so clip away the occluded regions by iterating wall segments from blue poly edge list - we get two polys we need to push down the red side child tree.
One of those new polys intersects the splitting plane (magenta / red) of the child tree, so continue recursively - we have the final result of visible areas.
So, you have an idea now i hope.
It's easier but similar to clip a line segment through the tree (determinate visibility between two points with out the need to calculate visible area first - so faster if you have not too many tests to do)
Or to find to which BSP leaf a point belongs (just determinate side of splitting plane to choose child node).
Also, by linking our white ploygons to the BSP leaves they ended up in, you can quickly determinate visibility for many points (you find BSP leave node for each boint and finally check visible area polys).
You also can temporarily add the visible area polys to the BSP itself if you want, ....
EDIT:
In this picture i've added a 4th wall to illustrate that the additional split only affects its parent polygon, not the entire scene. The other pictures did not make that clear but it's important for a good understanding.