Why is current flowing mostly through the base (NPN transistor)
Figure 1. From the datasheet on the linked site.

The diagram is telling us to power the sensor on 1 (+) and 3 (-) and connect the load between 1 and 4.







simulate this circuit &ndash; Schematic created using CircuitLab

Figure 2. The internals of the sensor.

These sensors are far more complex that you seem to have imagined. 


The type you have chosen is a retro-reflective type. That means that it has both a transmitter and a sensor. 
The sensor is digital. The output will be either on or off and not somewhere in between. That means it has to have some threshold logic to determine when to switch. 
The threshold logic will switch an NPN output transistor which will connect the output lead to ground when on. (Hence 'NPN' type.)
There will also be some hysteresis built-in so that once the on threshold has been exceeded that the light level will have to fall significantly before it turns off.
Several precautions will be taken to ensure that the sensor is not sensitive to ambient light so that it doesn't turn on and off when someone switches the lights or a cloud moves across the sun. These include:


Using infra-red light for the transmitter (not always).
Polarizing the transmitted light and using a polarizing filter on the receiver.
Modulating the transmitted light (the simplest is pulsing it on and off at, say, 1 kHz) and monitoring the reflected light for the modulation and detecting the change from on to off.



Most industrial control systems now use PNP sensors which switch the positive rather than the negative. This makes trouble-shooting more intuitive.

Note also that we have a symbol for transistors. There is no need to draw a diagram of PN junctions!