Experience, really. I guess you mean "they" to mean "native English speakers".
If we come across an unfamiliar word, we do follow a few clues to pronouncing it. There are typical rhythmic patterns we follow, plus pronunciation clues from the spelling. For example, if the word looks like it's from (Latinized) Greek, we might assume "ph" is spoken as "f" and "ch" would be a "k" pronunciation: phrenology, geochron.
Of course this doesn't work every time, but it works well enough. Sometimes we need to hear the word spoken as well. Unfortunately in English, we've borrowed a lot of pronunciation rules from other languages, plus some words keep a certain spelling even when the pronunciation changes over time. So like I said, experience will indicate the way you probably should say it, if you need
to guess.