In M2M, data is transferred from one device to another, while in IoT, there is a network of interconnected devices that can exchange information.