Historical materialism holds that social existence determines social consciousness, and social consciousness only comes after social existence.
Materialism claims that matter is the origin of the world, matter is primary, consciousness is secondary, matter determines consciousness, idealism claims that consciousness is the origin of the world, consciousness is primary, matter is secondary, and consciousness determines matter.