That's generally speaking how neural nets function.
The truth is that no one knows the specific process computerized neural nets arrive at the output that they do, just like no one knows how certain processes inside the brain work.
This article outlines the process fairly well: https://www.americanscientist.org/article/ai-is-blurring-the-definition-of-artist
You can learn more about machine learning and neural nets on medium as well.