breastfeeding confusion!

Daniela
I keep hearing people say they tried to breastfeed but they couldn't, it didn't work out etc. 
I'm new to this and I don't understand what the reasons are that people can't - is it that the baby doesn't latch on, they don't produce enough milk, or other reasons?
Thanks!