How can mutations create new traits?

New protein. Most mutations are problematic and create difficulty or are eliminate with normal bodily defenses. Rarely a mutation makes a new protein which has a useful function manifested as a change in the body or metabolism which confers and advantage and will therefore likely survive to the next generation.