A consulate is like a junior embassy. It’s generally located in a busy tourist city, and takes care of minor diplomatic tasks such as issuing visas.
The word consulate literally means office of the consul, who is a diplomat appointed to foster trade and take care of expatriates. You can read some pointed essays about the role of the modern day consulate at the American Foreign Service site.
Embassies are much bigger deals. The word embassy comes from the French ambassade, or office of the ambassador. Ambassadors are high-ranking diplomatic representatives who serve as spokespersons for their national governments.
If one country recognizes the sovereignty of another, they generally establish an embassy there. Embassies take care of the same administrative duties as consulates, but they also represent their governments abroad.
This can be tricky business. For instance, the United States doesn’t maintain an embassy in Taiwan (in order to maintain diplomatic relations with China), but it does operates a consulate there to take care of its overseas citizens.
For an interesting online look at another prickly diplomatic relation, check out the U.S. Embassy in Malaysia, which features a reaction statement to the recent incarceration of Malaysia’s former Deputy Prime Minister, Anwar Ibrahim.
You may recall the famous photograph from 1975 of American citizens ostensibly fleeing the American embassy in Saigon.
The building was in fact an apartment complex across the street, but the message was clear: once the embassy leaves, the country symbolically leaves.