Difference between 代わる 変わる and 替わる?

こんにちは!

I have been wondering why there are three different ways to write the same reading/meaning. Could anyone please explain the difference between them, if any?

ありがとう!

変わる = to alter some property of something
代わる = to substitute for something else
替わる = to replace (i.e. after the thing previously there has finished, like changing a lightbulb)

While we’re at it:
換わる = to change places with, to switch, a bilateral exchange

More info: