And how do they determine which is literal and which isn't? You do realize Googling "how to know what in the Bible is supposed to be literal" leads to some rather sketchy sites do you not? How about you throw me a bone?
Basically how any form of ancient literature might be scrutinized. Compared with other work of the day, which they can then put the work into historical context and determine intended audience.
The intended audience of most, if not all, of the Bible is not 21ist century English speaking people. Things become vastly different when looked upon in the light of the day.
The accounts of Jesus' apostles are personal descriptions of things they've witnessed as they walked with Jesus. Romans, Philippians, Colossians, etc are letters to those respective people.
Psalms consists of poetic songs.
There are other sections of the Bible that are instructional, how to build a Temple for instance.
Some biblical books were not even intended as written works to be compiled in a whole.
Within it consists several genres, like a library. And those genres can be determined by scholars who sometimes spend their entire lives studying the Bible. I would suggest you read it some time, even simply for the purposes of gaining a better understanding of where others are coming from when they talk about their beliefs. NLV is the easiest translation to read, ive found. KJV is the opposite end, much more confusing.