Collection is characterized by lowering of the croup; and increased angulation of the joints of the hind legs - it feels as if the horse is sitting down a little behind; and their front end gets lighter and taller.
True extension is developed from collection - you ask the horse to collect to coil the spring, extension releases some of the coiled energy while maintaining the "sit" behind.
Collection and extension are developed through systematic, gymnastic dressage training - it's not something an unfit or untrained horse is capable of.
What gets confusing is that this fairly precise terms are often used generally to describe shortening and lengthen of stride, without any change in the horses' balance or engagement. Lots of non-dressage riders will refer to a slow trot or canter as "collected" when, by the precise definition, it's just shortened. Same for extended/lengthened. There's nothing bad or wrong about that; there's value in teaching a horse to shorten and lenghten, it's just not the same as collecting and extending in the more precise sense.
So not only do you need to know the definition of the terms, you need to know in which sense the speaker is using them - the precise, dressage sense or the more general sense.