The properties of a body depend on how its molecules bind to each other. Whether a body is brittle or malleable determines how easily the molecules attach to each other. And it depends on the complexity of a substance's structure.
Iron comes with a simple structure. When you disconnect its molecules (bend them), they just bind with other molecules. Similarly, you can bend it the other way.
Glass has a more complicated structure. So when its molecules come apart, it just collapses.
The more complex the structure of something, the more fragile it is.