How do neural networks create results like its inputs?
These are known as Autoencoders. As you said, these neural networks are trained to produce output that is similar to the input, rather than output a classification of some kind.

Internally, they do not differ much from other neural net designs. Simply, the expected output is the input (or a slight variant of the input), rather than a classification.

One difference however is often the level of depth. Networks designed to replicate sequences, like writing jazz music, need to remember a sequence throughout training and prediction. This is where deep learning succeeds better than other methods.

This paper briefly discusses one type of an auto-encoding network and how it's used to produce music. I think you will find the design is very similar to a traditional neural network.