A kernel is a little corn — and that sentence makes perfect sense once you know what corn used to mean. Old English corn referred to any grain: wheat, barley, oats, rye. The suffix -el marked a diminutive. A cyrnel was a small seed, the tiny grain hidden inside a husk.
The PIE root *ǵr̥h₂nóm ('grain') produced parallel forms across the family. German Kern means 'core' or 'nucleus'. Swedish kärna means 'kernel'. Latin grānum (from the same PIE root via a different path) gave English grain and granule. The idea of a small, essential seed at the centre of something has persisted for six thousand years.
Corn's narrowing to mean 'maize' happened only in North America. English colonists called the unfamiliar crop 'Indian corn', then dropped the qualifier. In Britain, corn still means wheat (or whatever the local staple grain is). Kernel, meanwhile, never shifted — it retained its general meaning of 'the inner seed'.
The computing world borrowed the word in the 1960s for the core of an operating system — the essential inner part that everything else depends on. It may be the most etymologically accurate metaphor in technology: a kernel is the seed from which the entire system grows.