Chocolate and cocoa are made from the same raw material, cocoa beans.
Cacao beans are fermented, dried, crushed, peeled off, roasted and ground into a paste, then solidified (called cacao mass), and then solidified with cocoa butter (oil and fat from cocoa beans), milk, and sugar.
Cocoa is made by removing some of the cocoa butter from the cacao mass and turning it into powder.