Melatonin products are usually synthetic versions of the hormone made naturally by the pineal gland, 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 pineal gland of the brain and is present in certain foods.