In Programming language principal generally we consider State & Behaviour State can be consider as properties(let, var) & Behaviour as Functions.
For example: – dog, cat, and vehicle. To illustrate, a dog has states like age, color, name, and behaviours like eating, sleeping, and running.
State tells us how the object looks or what properties it has.
Behaviour tells us what the object does. We can actually represent a real world dog in a program as a software object by defining its states and behaviours. Software objects are the actual representation of real world objects.
As per Apple doc Extensions add new functionality to an existing class, structure, enumeration, or protocol type.