What actually makes a material ductile or brittle ?

What actually makes a material ductile or brittle ?