Libraries are great public spaces (especially when they don’t have people speaking hate in them, amirite, TPL?) while museums feel less…. public. Why?

I have spent a great deal of time thinking about the relationship between museums and public libraries, to understand what makes libraries feel different from museums. Why do they have a public spirit that most museums don’t? Why are there lines around the block at some NYC library branches at 9 am? I’ve been reading about the roots of both institutions in the United States, and they have evolved in similar ways; so how do they diverge? And is this divergence relevant to the ways in which a stunningly broad swath of society feels welcome within a public library and not a museum?