One trouble with extension cords is that they’re often in the way. People can trip over them. Or possibly even worse, walk on them. Walking on a cord can damage it. This isn’t the only way the cord can be damaged. If used outside, it can deteriorate due to exposure to the sun.
If the cord is damaged, it can create a short circuit, which can result in overloading and overheating of the wires inside and possibly a fire. The hazard can be heightened if an indoor cord has been tucked under a rug to prevent tripping. Under the rug, the cord can be damaged by being trod on, but the damage is hidden. And the rug only adds to the fire hazard.
Extension cords that provide more than one outlet and allow more than one appliance to be plugged in create another hazard. They can allow overloading of the wires in the cord and overheating.