They are made of the same substance Calcium Carbonate, But are formed in different ways.
Chalk is formed in a deep marine environment from the shells of microscopic algae which flourish near the surface, but die and fall to the seafloor. The kind of chalk used in old-style classrooms and lecture theatres scrapes off a thin layer of fine white dust as they are scraped over the abrasive surface of a "blackboard".
Marble is metamorphosed limestone, ie subjected to heat and pressure, the crystals grow and interlock, forming a stronger rock, more suitable for a building material. Sometimes minerals in the original limestone are still visible as swirls of colour in the marble