there is little external force that slows earth's spin(If there is no external force acting then it will not slow down and will rotate forever.).
A large part of it is due to something called tidal braking, which basically means that the Moon's tidal pull is acting like a drag on our planet.Also, the world's sea levels, as well as electromagnetic forces between Earth's core and its mantle have an affect on Earth's spin too, which is why it's so unpredictable.