For fully AC trains like Rajdhani and Shatabdi, generator cars are used to ensure a continuous, uninterrupted power supply.
For LHB non-AC trains ( like Poorva, SK etc), generator cars are used because the current LHB coaches used in IR are non-self generating. ICF coaches have alternators connected to the wheels that generate power while the train is moving and store it on the on-board batteries. These are called self-generating coaches. This arrangement is present in both Non-AC and AC coaches. That's why trains running with ICF coaches don't require any generator cars.
...
more... Even if the train is fully AC with ICF coaches, technically you need not have generator cars, but for reliability they are used ( Correct me if I am wrong). There was an instance recently when the Patna Rajdhani was run with ICF coaches during the fog season and it did not have EOGs ( again, correct me if I am wrong).
Self- generating LHB coaches are still in the design and optimization phase, so all LHB trains (AC like Rajdhani, Shatabdi and normal express) will need to be run with generator cars till they are developed.
There is a provision to use the power directly from the overhead wires through the locomotive, called Head-on-generation (HOG). This is present in WAP5, WAP7 locomotives. Technically using HOG should remove the need for diesel EOG's, but it is not a straight forward thing to just power an entire AC rake through the HOG, there are many loading issues that are not easy to resolve.
You can look at the following pdf for information on how self-generating ICF coaches are designed, I got this from the South Central Railways website.