This video demonstrates the shear strength of a standard construction nail, compared to a deck screw. The screw snaps off after a couple twists, but the nail remains intact and in the wood after multiple twists. This test clearly shows that nails are the better choice for structural construction framing where joints and lumber can shift and twist.
But don’t write off screws altogether. They have stronger holding abilities (tensile strength) than nails and can draw pieces together.
The best example for when to use a nail versus screw is building a deck. Nails are used to attach the joists to the deck framing, and screws are used to fasten the deck to the frame.