The difference being that the owners of the works in museums have given permission to view the content, and the people viewing the content are rarely trying to resell what they are seeing.
With image generation software it's not intending to give you a one-to-one copy of the original source, in fact many of the algorithms have it coded to avoid that all together (or attempt to) it analyzes common image patterns that are done much like how humans when they go to an art gallery. The only difference is instead of it being one Art Gallery it's a massive art pool, and instead of it being limited to the human mind which can only remember so much art at once it can remember it all. So you essentially have to look at it as one huge art gallery that the artist has access to 24/7.
It's essentially the same as any artist who entered the museum, it just can remember everything that it saw instead of one or two things that it saw