What's the difference between "Что ты улыбаешься?" и "Почему ты улыбаешься?" or in some other similar cases?
"Почему" simply means "why/what the reason"; "что" also has a variety of context-dependent informal meanings, including a mix of "why/what for". "Что" may also introduce a rhetorical tone to the question.
In your example, "Почему ты улыбаешься?" is always a neutral or friendly question, meaning "What made you smile?" The person who is asking is interested in an answer.
"Что ты улыбаешься?" may mean exactly the same when told in a positive manner, but it can also work as a rude opening, meaning "You'd better not be smiling". The person who is talking like that implies that there's nothing to smile about and/or that the smiling won't make any good. In that case, there's even a more aggressive version of this question: "Что ты лыбишься?" ("What the f*k are you smiling at/for?"). In many cases you can't really tell is "что" "why" or "what for", it is context dependent.
"Что" in this type of questions will never be used in formal speech.