What's the difference between зачем? and почему?
Зачем? is a question about the purpose ("what for?") and
почему? is a question about the cause ("why?", "because of what?"). The next two sentences can both be translated "Why have you come?", but they have the shades of meaning which illustrate the meaning of
Зачем ты пришёл? means "What are you expecting to find (hear, see, etc.) here?"
Почему ты пришёл? means "What made you come here?"
Sometimes this difference gets too slight and can be neglected, especially in the colloquial speech, the two words can be used interchangeably. But there are some contexts when they cannot be substituted with each other. When you ask what a thing is used for, only
зачем? must be used, like
Зачем нужна эта кнопка? ("What is this button used for?").
Зачем? cannot be used when asking about some actions that have no purpose, like crying, dying, sitting, etc., only
почему? can be used in such questions, like
Почему ты плачешь? ("Why are you crying?"). Still, sometimes the context can be weird and somebody is crying on purpose and is being asked about that, but that is a rare case.