This is a good question. It seems that the idea that art imitates lift was a proverb that was famous for a long time. It is the idea that Plato even stated in ancient Athens. Art, according to Plato, is mimetic, that is, art seeks to be like life, but it falls short. For this reason, Plato sometimes does not look on some arts too favorably, like poetry. In fact, he banishes poets from his ideal republic.
The person who made the opposition point that life imitates art was Oscar Wilde. He made this remark in an essay in 1889. The title of the essay was, "The Decay of Lying." His essay was written in platonic style, probably as a tribute to Plato. He argues that life wants to find expression, and the best way it finds this expression is in art. From this perspective, we can say that Wilde's point is the opposite of Plato.
In conclusion, when you put these to ideas together, you have the idea of art imitating life and the idea of life imitating art.