If you don't have any mexes connected to your grid or any allies to load your excess energy to then you will excess energy.
Your non-connected energy is prioritized towards usage in your normal economy such as repair, building, rezurecting.
Then your energy bar will be completely filled up with remainder of the energy.
If one of your allies is estalling then the remaining energy will go to them.
If you still have some energy afterwards and it is connected to the grid, then it will overdrive your mexes.
Next if there is still some left it will be granted to your allies that don't have the full storage/capacity to overdrive.
If all above fails then your energy will be completely wasted and excess will happen.
usage -> storage -> ally estall -> overdrive -> ally storage and ally overdrive
This is the same case with metal income but without the overdrive part.