My 6-month-old baby gets diarrhea on taking new formula milk. Why does it happen?

Can changing formula milk cause diarrhea in 6-month-old babies?