However I agree that EU can also be used as a scapegoat when implementing unpopular policies, unfortunately. They can claim that they totally didn't want it but EU mede them accept it.
It's more like a club where the countries come together to decide how to do things and then they implement local laws to do it. They are not hostile countries brought together by force, the hostilities are usually between neighbours and EU acts as a way to resolve them. For example, countries close to the borders see large refugee influx and the countries further away don't want to have anything to do with that and EU tries to find a way to ease the pressure on the border countries(so far, not very successfully but managed to create a mechanism of keeping refugees outside of EU by paying the host countries like Turkey). Or let's say a country wants to join EU, an EU country might have long standing disputes and EU tries to find a common ground to mediate it(Bulgaria & Northern Macedonia is a vivid recent example). Or let's say there's ethnic issues causing wars and other tragedies, EU creates a law to guarantee the rights of the minorities so that the ethnic issues are no longer relevant those resolved.