The word "why": what's the difference between 为什么 and 怎么?

In Mandarin, usually 为什么 is used to express "why". Sometimes 怎么 is also used to mean the same thing.
What makes them different? Most grammar books I beleive introduce 为什么, but I feel many Chinese use 怎么 on WeChat. Since 怎么 also means "what" or "how", sometimes I got stuck to understand what it means on a context.
Also, is there any other words to mean "why", except them and 为何 (which is the same as 为什么 but literary, right?) and 为啥...?