Anarchism is what you get, when you go so far left, you fall off the spectrum. Klanarchism is what you get, when you go so far right, you fall off the edge.
Anarchists are opposed to government from the top down; but support government from the bottom up.
Socialists are more in favor of stronger government from the top down.
Want to start a good brawl? Lock a bunch of Anarchists and Socialists together in the same room.
During the Spanish Civil War (1936-1939), the Fascists won because the Anarchists, Socialists, and Communists spent more time shooting one another, than they did in shooting Fascists. (That is what is known as a 'dialogue on the Left'.
Anarchism – Less a political philosophy than “a widely diverse assemblage of political beliefs that converge only on being anti-authority, anti-state and anti-coercion.”
Socialism is an "economic theory favoring total or partial public control of the economy.”
Social Democracy combines the ideas of a representative democracy with a partially or wholly socialist economic order, where key sectors of the economy are controlled directly or indirectly by the state.”
30-Second Politics Editor, Taylor, Steven L.
Anarchism falls within the spectrum of socialism. It is the most anti-state and anti-hierarchy form of socialism. See the post by St. Sinner below for a good explanation of the similarities and differences.
Libertarianism, which many call right-wing anarchism, still accepts capitalist hierarchy. So it really isn't anarchist. It is merely an excuse to leave things the way they are for the benefit of upper class and white privilege.
Noam Chomsky Is probably the most famous and accomplished anarchist in the world. This is why he criticizes capitalism and defends socialist governments under attack by imperialism.
The explanations lie in examining reality and not in speculative theorizing.
I think there are not any purely socialist, anarchist, democratic or other governments; thus, such distinctions are academic. In practice, power politics control governments, and the best ones serve the majority of people well, unlike the current government in the US.
Although many people think of the US as a democracy or a republic, in fact the wealthy make most decisions, so it is closer to an oligarchy. IMO we have almost the worst kind of government, a dictatorship tends to be worse. But a benevolent dictator could be better; unfortunately, there is no way to assure the successor will be benevolent.
I think calling a government socialist, democratic, or whatever leads to confusion, because all governments are a mixture of isms. Moreover, like our government, all of them change according to the whims of those in power. Maintaining a good government is a lifetime responsibility of citizens, and sometimes it requires the ultimate sacrifice.
The major difference is that they don't resemble one another at all. Anarchism is against organization and government. Socialism is an economic (rather than governmental) system (anarchy, being against organization, allows for no system to all) that relies on pooling resources for the common good. They have nothing to do with one another and would be mutually exclusive.