It’ll be a 70s thing. There was a rebellion against the gallery/dealer/patron system in the 70s and its where a lot of art forms that are for the ‘public’ rather than for the ‘patron’ come from. So its where a lot of the art forms that take art out of the frame / off of the plinth and out of the gallery come from
Public Art (as opposed to civic statury), Community Art, Land Art, Live Art and Performance Art and so on they are all movements and practices about artists address the broader public directly rather than the private buyer.
Public collecting funds – buying art for public display and ownership all pretty much stem from that era too. The various Arts Councils around the UK began their support for visual art (the were all about opera and theatre originally) by buying it for the public rather than funding its creation.
I’m not sure thats the same as an artist make in a piece of work and giving it away to someone rather than everyone has any really history though. Graffiti art has the same aims public art at its heart maybe but without giving consideration to invitation or permission from the ‘public’.