HA Changing Entity Name _2 Discussion

I’ve been running Home Assistant for years and really love it, but on occasion I’ve lost data from entities because HA created a new name_2 and I’ve never seen much of a discussion around why this happens. I’d like to know if it is something I’m doing, or something I can prevent or what exactly causes this. I’d like to be able to fix this when it does happen as I’m very interested in long term data capture and analysis, but having the data sliced into separate entities doesn’t help and fixing it never seems straight forward or confidence inspiring.