Why do we add capacitors on center taps to the magnetics when
connecting to an Ethernet PHY?
I would say that protection of victim electronics (blue below) from capacitively coupled line surges is going to have some part to play here: -
Despite the magnetics being an isolating transformer capable of substantially dealing with several kV surges, there is still capacitive coupling between PHY and line sides. The 100 nF capacitor is certainly capable of "containing" what is left from a line surge after passing through the CM filter and across the parasitic capacitance of the magnetics.
I did have a quick look on the internet but I was surprised to find that there wasn't clear-cut documentation about this. I'd like to be more confident about this but, it could certainly be there for diminishing the last remnant of surge current thus protecting the "victim circuits".
Also what is the reason on why we terminate the other side of the
magnetics with a resistor and a capacitor?
Stack exchange Q and A on the Bob Smith termination.