The energy for the development of the phosphodiester bond comes from the dNTP, which must be added. dNTP is a nucleotide that has two extra phosphates joined to its 5' end.
To get the 3'OH assembled with the phosphate of the following nucleotide, one oxygen must be eliminated from this phosphate.
This oxygen is likewise connected to an additional two phosphates, which are additionally joined to an Mg++, accordingly framing the phosphodiester bond.
The 3′ finish of the DNA harbors an OH bunch which can cooperate with the approaching nucleotide's phosphate situated at its 5′ ends to bring the nucleotide into the developing DNA chains by a phosphodiesterase enzyme.