Melatonin products are usually synthetic versions of the hormone made naturally by the pinealgland, in the brain, which helps regulate the body's sleep-wake cycle.
The reason for this conflicting opinion is that as well as being available in pill form, melatonin is also produced naturally by the pinealgland of the brain and is present in certain foods.