Kalman gain
The Kalman gain is a number — really a small set of numbers — that answers one question at every step of a filter: when my prediction and my new measurement disagree, how much should I trust the measurement? Imagine you guessed a friend will arrive at 3:00, then a text says the train is running late. The Kalman gain is the dial that decides how far to slide your guess toward what the text says. Turn it all the way up and you throw out your prediction and believe the measurement completely; turn it all the way down and you ignore the measurement and stick with your prediction.
What sets that dial is the relative uncertainty of the two. If your prediction is shaky but your sensor is sharp and reliable, the gain is high, so the correction leans hard on the measurement. If your sensor is noisy but your prediction is solid, the gain is low, so you barely budge. The filter computes this balance automatically from how much spread (uncertainty) it carries in its prediction versus how much noise it expects from the sensor, and it recomputes the gain every single step as those uncertainties change.
The gain does double duty: it tells the filter how much to nudge its estimate toward the measurement, and it also tells the filter how much that nudge should shrink its uncertainty. A measurement you trust a lot both pulls the estimate strongly and makes the filter much more confident afterward. This is the small piece of arithmetic that lets a robot blend a steady stream of imperfect readings into one estimate that is better than any single source.
A drone predicts it is at 10.0 m altitude (a fuzzy guess) while its barometer reads 10.6 m (a fairly trusted reading). With a gain of 0.7, the filter settles on about 10.42 m — most of the way toward the measurement, but not all of it.
A high gain pulls the estimate most of the way to the measurement; a low gain would have left it near the prediction.
The gain is not a single fixed setting — it rises and falls on its own from step to step as the filter's confidence in its prediction and in its sensors changes.