Microscopic mechanism of level attraction from coherence-dissipation competition