Neural network learns a set of weights, so that when your data is multiplied by them and passed through some non-linear functions, they are able to predict the target variable as actually as possible.
You can argue that this is a low-level answer to your question, but at least it does not give you the false sense of what they can learn.
Neural networks can learn some reasonable things about the reality, but nothing prohibits them from learning crazy interpretations of the data they "seen". It is often the case that neural networks overfit, i.e. learn bogus features, that "work" for making predictions on training set, but do not generalize to new data. To give example, neural network trained to detect wolfs on images, learns to predict that if picture contains white spots (of snow), there must be a wolf, because all the wolfs it has ever seen in training set, were photographed in winter.
Why can't the ordinary neural networks generate new data like GANs? First of all, they are deterministic functions and you cannot take samples from deterministic functions. You can overcome this by using Bayesian neural networks that treat parameters as random variables, so that you can samples of them. Still, even in such case, if the network was not explicitly trained to learn accurate representations of the data, it does not have to be the case that if network was learned on images, you would be able to generate any meaningful images using it's weights. For example, neural network that detects cars may learn to detect wheels on the pictures, while image containing only the wheels is far from realistic image of the car.
Neural networks, like other machine learning algorithms, learn to detect patterns in your data, such that enable them to make predictions. Those can be any kind of patterns. They are more like lazy students on an exam, that when discovered that "A" answers in multiple-choice questions test are usually correct, so instead of learning to exam, they just always answer "A", without even reading the questions.