Calcifer is a fallen star who was caught by Howl. He didn't want to die, so he struck a deal with the wizard. Calcifer got Howl's heart and a prolonged life, and Howl received full access to all of Calcifer's considerable powers.
As it turns out, neither of them liked it after a while, but it couldn't be broken by people who were part of the contract. When Sophie Hatter comes to Howl's moving castle, Calcifer recognizes that she is under a curse thanks to the Witch of Waste and that Sophie has considerable powers of her own of which she is unaware. To break his own curse, Calcifer offers to lift the curse placed on Sophie once she manages to break Calcifer's contract with Howl.