You're putting the cart before the horse. Countries only join the EU after they establish friendly relations with the rest of the EU members and become democratic.
Joining the EU is seen as desirable to these countries, so they work to establish friendly relations with the rest of the EU members and become democratic. The horse and cart are properly ordered.
Romania, Croatia and Bulgaria all introduced democratic reforms and resolved disputes specifically in order to meet accession requirements. Albania, Montenegro, North Macedonia and Serbia have all also made reforms and/or resolved disputes as part of their ongoing accession negotiations.