Any character can attempt to pass an ability check
But nobody is guaranteed a success or a failure. It is useful to recall that an ability check only is attempted when the DM calls for a check because "something is going on" and there is a need to determine "what happens next" as a result of a character trying to do something.
An ability check tests a character’s or monster’s innate talent and training in an effort to overcome a challenge. The DM calls for an ability check when a character or monster attempts an action (other than an attack) that has a chance of failure. When the outcome is uncertain, the dice determine the results.
That part up there will be important to remember when you are a DM.
For every ability check, the DM decides which of the six abilities is relevant to the task at hand and the difficulty of the task, represented by a Difficulty Class. The more difficult a task, the higher its DC. The Typical Difficulty Classes table shows the most common DCs.
What proficiency and expertise offer is a higher chance to succeed on any given check.
There may be an occasion that a DM will assign a very high DC (like 25) and if someone wants to try it alone, the DM can advise them that it's too hard for them. But see below (the section on skew the odds in the character's favor) on how you can make success more possible by using Help, Guidance, Advantage, or Bardic Inspiration to put the odds more in the character's favor.
Do I have this correct? How can I (or should I?) express that a person who doesn't know History has no chance of passing a history check
Since you aren't a DM you don't have to, but since you want to be one let's walk through this ahead of time.
There is no gating of "you can't even try" as implied in your question.
It's not a matter of not knowing, or knowing, history: it's a matter of how much history a given character knows or remembers. @Alan Mills' answer gives a nice example that I'll not repeat here. History is an Intelligence ability check (PHB, Chapter 7, Using Ability Scores; read the whole thing). According to Chapter 7,
Intelligence, measuring reasoning and memory
We see in the Chapter 1, description of abilities ...
Intelligence Measures: Mental acuity, information recall, analytical skill (Basic Rules, p. 10)
What is being measured is the chance that a character recalls or knows something.
How do I make sense of this as a new player?
Since you say that you are new to D&D in your comment, you don't have any real points of comparison to base your intuitive grasp upon.
@KorvinStarmast im brand new to DnD I know jack about other editions...
What you are running into is an expectations mismatch between the game and your experiences with life, and what terms mean in normal conversation. That's fine. The ability / skill system for this edition of the game has puzzled plenty of us who have been with the game for a few editions. There are a lot of questions about skills and abilities on this Q&A site, and on forums/discussion sites for this game. In a nutshell, it is a matter of comparative difficulty, not absolute difficulty.
Being proficient in History does not make a character a Historian
All it makes the character is better at history checks than another character who isn't proficient.
Having expertise in history would be closer to "being a historian"
Even though that's still an awkward mapping of real life meanings to game mechanics meanings, let's look at what expertise does since it doubles a proficiency score.
- Expertise is a Rogue class feature, but the doubling of a proficiency bonus crops up in a number of other places in the game via other features.
Let's apply this idea to your +5 bonus to History checks example. That bonus does not exist in a vacuum. Someone had to choose to assign points to Intelligence to get that score as a beginning character.
At first level, this character is already out of the ordinary. They need a 16 Intelligence (+3 to Int based checks) and Proficiency in History to get that +5.
A commoner has an intelligence of 10 (+0 bonus to the roll), and an average player character has an intelligence of about 12 (+1 bonus to the roll) if you roll up your character using the 4d6-keep-the-best-3-dice, method. (Chapter 1, p. 9)
Without proficiency that 16 Intelligence character has a +3 to History checks. With proficiency the character has a +5. With expertise the proficiency bonus is doubled, so History checks are made with +7. That's closer to "expert/historian".
Let's raise that character to level 5 and thus have a proficiency bonus of +3. (see the table on Tiers of Play, PHB p. 17, Basic Rules p. 12). +3 for Int, +3 for Proficiency, +3 for expertise (double proficiency) and now you have a +9 ... versus the commoner with a +0 and the average adventurer who has a +1. The commoner doesn't know no history, he just doesn't remember a lot of history.
By the way, the percentages that have you so concerned ... don't actually matter. Each roll of the dice is its own instance, and the d20 system is kind of swingy that way. If you have +9 and roll a 2, you still fail that DC 15 check. A given roll of the dice doesn't care what the odds are. Also, a DC of 15 means "roll equal too or greater than 15."
You have your probabilities slightly skewed: the probability of rolling 15 or more on a d20 is 30%, not 25%. ~@kviiri in a comment
How important is this history check?
In Chapter 7, the rule is that unless success or failure is significant, it isn't necessary to roll. The DM just narrates the outcome. This is true with any ability check.
- Here's the "Prepare you to be a DM" piece: you don't even have to
roll if knowing or not knowing something doesn't make a significant
impact on a player character decision or situation.
Skew the odds in the character's favor by using class features
Find ways to get advantage on the roll for the ability check. That boosts your odds of success from about a +3 to a +5. If you look in Chapter 7, you find that getting Help from a fellow character gives your character advantage.
Sometimes two or more characters team up to attempt a task. The
character who’s leading the effort—or the one with the highest ability
modifier—can make an ability check with advantage, reflecting the help
provided by the other characters (Basic Rules, p. 62)
Have your party cleric (or druid) cast guidance (a cantrip) on the character. That adds from 1 to 4 to the roll.
Ask the bard for bardic inspiration; that adds 1 to 6 to the roll at first level.
And now we see how a commoner with an Int of 10 can have a good chance to make that DC 15 roll (using averages): +4 from Advantage if they get help, +2.5 from guidance, and +3.5 from a bard's inspiration. That's a +10 on a d20. They have a slightly better chance to recall that historical factoid than the 5th level character whose expertise gave them +9. The commoner's Target Number is 5, and the "expert's" target number is 6. (TN meaning "that number or higher and I pass the check).
The second half of this answer by @NeilSlater is a fine explanation of how to make the ability check, and the contest rules that are in Chapter 7, work when you are a DM.