Depends on the game, but generally, it's an exponential function. The more useful the unit is, the more I care for it.
I'm the kind of guy that loves to send in a death squad - a unit explicitly meant to prolong the battle, but who I honestly do not care if they live or not - before utilizing my units in another manner which won't exactly lead to their deaths.
Europa Barbarorum, a mod for Rome: Total War, is actually amazing for this. The simpler, weaker levies that are there actually do jack shit in battle other than keeping the enemy at bay while you are meant to use your stronger attack units to do the damage. Sending them to hold the line is part of the job. As long as your damage units aren't being wiped out, those losses are acceptable.
But the heavier units that I got, I fucking loved them. This one game, I was trying out the Casse, and I managed to conquer the British Isles - opening up a unit that is only produced in Southern Ireland, and that was an absolute monster. This unit was about as expensive as a ship, and 10 times as expensive as regular units in terms of upkeep. Just two of these units could cripple your economy in upkeep. But they were unstoppable on the battlefield - heavy infantry with a defense rating so good you could put them up against any other unit and they would hold the line for practically forever. So it hurts to see that unit lose more than 10 soldiers in a battle. If that unit got wiped out miraculously (and I maintain you need an actual army to destroy one of those units), it would be a huge blow to that army. So those losses, I avoid them. If I lose that many soldiers, I pull them out and start sucking up the damage to the damage units instead.