Sealed classes in Kotlin let you define a fixed set of subclasses. When you use a when expression on a sealed class, Kotlin requires you to cover all subclasses. This makes your code safe because you handle every possible case. For example, if Shape is sealed with Circle and Rectangle subclasses, your when must handle both. If you miss one, the compiler shows an error. This exhaustive check prevents bugs. The execution table shows how the when expression checks the type step-by-step and returns the correct area. If you add a new subclass later, you must update the when expression or the compiler will warn you. This helps keep your code correct and easy to maintain.