Well, getting a yard in the NFL isn't typically a big problem and 3rd and 1 vs 4th and 1 are feasibly no different. But turning the ball over inside 30 yards is at least 3 points for the other team with only rare exceptions.
Meanwhile, on fourth down, the defense is amped up and ready to roll. You'll usually see a strong blitz against a sputtering offense, and the percentage of plays that actually get a yard is going to be lower.
Not only that, going three-and-out means that the offense is unlikely to do any better going from the 10 to the 20 yard line. Better to punt the ball, trust your defense, and have your offensive coordinator fix whatever is going wrong.