Laptop keyboards connect to the main board through a thin ribbon cable. If that cable works loose, the entire keyboard stops at once. If only some keys fail, the problem is more likely physical damage or debris under those specific keys.
Liquid damage can take days to show. A small spill may seep under the keys and leave a sticky residue that stops switches from returning, so keys feel mushy or do not register until they are cleaned or replaced.
Software can also disable a keyboard. Filter keys, sticky keys and some accessibility settings change how input is handled, and a bad driver update can stop the keyboard from being recognised until it is rolled back.
An external USB keyboard is the fastest diagnostic. If the USB keyboard works while the built-in one does not, the fault is almost certainly in the laptop's own keyboard hardware or its connection.