I'm quite sure that what on Earth and what in the world are synonyms, you can use both of them and the meaning will be the same. I think you use those idioms to intensify. you're telling your child to prepare a meal and he/she does it all wrong and in order to underline how astonished/disappointed/surprised you are you will say: What on Earth/in the woeld have you done!!!!
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.