Critical hits are introduced in the PHB under "Attack Rolls":
If the d20 roll for an attack is a 20, the attack hits regardless of any modifiers or the target's AC. This is called a critical hit, which is explained later in this section.
Then, later in this section under "Damage Rolls":
When you score a critical hit, you get to roll extra dice for the attack's damage against the target. Roll all of the attack's damage dice twice and add them together. Then add any relevant modifiers as normal. To speed up play, you can roll all the damage dice at once.
The fact that the rules on critical hits are divided in this way makes it difficult for me to find a clear rule that says that critical hits can only happen on hits that follow after making an attack roll. Differentiating between a successful attack and a hit is not merely a theoretical nitpick, but actually relevant, as e.g. this question shows: Does the Piercing Arrow of a multiclassed Arcane Archer fighter/Assassin rogue crit against surprised creatures?
So my question is: Is there something in the rules that allows us to infer for certain that only hits resulting from an attack in the mechanical sense (i.e. something that involves an attack roll) can be critical hits?