Midjourney or Dall-E: How is an image created with artificial intelligence?

Having images created with Midjourney or texts created by ChatGTP is frightening and fantastic at the same time. What’s behind the technology? And how can we recognize that an image comes from an artificial intelligence?

source site-1