Rejection is something we all have to deal with. There are three main Reasons For Rejection:
They thought what you were offering was shite. (Although never expressed in quite these terms, this is a difficult one to deal with. It commonly leads to extended periods of sleeplessness/anorexia/thoughts of self harm.)
They thought what you were offering was okay, but found that it didn't hold their interest.
They thought what you were offering was good, but it didn't fit in with their plans.
Writers should note that the above three Reasons For Rejection also apply to knockbacks you may receive from agents and publishers.