what causes diarrhoea with fresh blood in it?

Generally, if there is blood visible in the stools, it is not diarrhea but dysentery which may further results in severe diarrhea containing mucus or blood in stool.
It is due to viral, bacterial, or protozoan infections or parasitic infestations.
This pathogens damage intestinal tissue so severely that blood vessels ruptures, allowing visible quantities of blood to be lost with defecation.