Traffic lights: why yellow before green?

Traffic lights around the world use the yellow light to warn people that it will soon turn to red, so that people can stop before. This is perfectly understandable.

However, I found out that in some European countries the yellow light is also shown when going from red to green.

Can somebody tell me what's the purpose of this? From my judgement, it is completely unnecessary. It's not like it is warning drivers of any danger. Do drivers need a sign that tells them to "prepare to go, but don't go yet"? And why would they need it?