A theory for ferromagnetic lubrication