In Chinese sentences, 什麼, meaning “what”, simply takes the place of the information you’re asking about. Let's look at the sentence 那 輛 車 撞倒 了 這 棵 樹 。 which means, “That car crashed into this tree.” You can replace the tree, so it becomes 那 輛 車 撞倒 了 什麼 ？ which means, “What did that car crash into?” Or you can replace the car, so it becomes 什麼 撞倒 了 這 棵 樹 ？ which means, “What crashed into this tree?”
When paired with 也 or 都, 什麼 takes on the meaning of “everything”, “anything”, and “any”
There are some instances in which 什麼 means “any” or “anything” even without the 也 or 都 pairing.
Essentially, it takes on this meaning when used as a modifier instead of a question word.