Why do concrete buildings crack

Concrete slabs are very strong in compression and weak in tension. For example in a beam when the applied load crosses its tensile capacity the concrete in the tension zone cracks and the steel rebar stretches and takes over the load. However when the concrete is pulled to a certain extent it cracks.

Most softwares assume that beams have only 35% of stiffness left and other 65% is lost due to cracking.