While recall elections might prevent local and state government officials from doing the opposite of what was promised, promises are exactly that, just promises.
The promises are free to be broken, but remember that very often candidates will wish to be reelected to their offices and that relies on citizen's opinions.
Using the United States of America as an example, delegates/members to the House of Representatives are up for reelection every two years, simplifying the idea of how party politics works in the US (ie caucusing with the affiliate party), this leaves their jobs at the whims of the people. Thus should they ever hope to advance they will need to make sure to effectively pander and do the bare minimum needed to keep the promises.
A counterpoint to that is that Senators often have more leeway to negotiate and compromise due to their six year terms. Many senators, such as Dianne Feinstein and Barbara Boxer of California, often do not face contested reelection bids, allowing them to move across party lines and make fewer and less bombastic promises during campaigns. Very often, you see those running for Senate running on very vague platforms in contrast to Representatives who promise substantial things such as tax cuts and ending Obamacare.
So the answer is that while there is no legally binding obligation to keep promises, Members of the House usually have to promise and appear to do more to keep those promises due to job security, in contrast to Senators who often make few promises and are laxer about keeping them.
In the general answer then, it would follow that promises are kept to build trust for a given political party, thus consolidating party backers (voters) and creating a basis for a party platform. In this regards, renegades of parties often get around this broken promise business by jumping to a more established party, or by starting their own and hoping to garner support for it. Either way, breaking promises can be a quick way of killing a political career.