No it’s not an automatic fold. That’s why you should always table your cards (turn your cards face up) if you are unsure if you have a winner. You might have missed that you had a flush or straight or whatever. Once your hand is tabled then cards talk. And you should always have your hand on your cards until the pot is pushed to you for your own protection.
Here is a good example of why you should table your hand and I’ve seen this a lot at tables. Say like you said 2 players are in a hand and on the River player A bets, player B calls. Player A says “I have a straight.” But they don’t turn their hand over. If you had lets say top pair and you fold without tabling your hand and the dealer gets them into the muck, then player A turns over his hand and he doesn’t have a straight, either because he didn’t pay attention to what they had or they are straight up angle shooting you, you are pretty much out of luck in getting that pot because you have no way to prove now what you had.