Let's say, a Muggle witnesses some magic and needs to be Obliviated. How does the wizard know how far back to erase the memory so that the person wouldn't remember anything about magic but would still know who they were and have all of their other Muggle memories? Or maybe wizards don't care?
The spell itself does not determine how much memory is erased, the wizard does. When Lockhart tried to erase the memories of Ron and Harry and Ron's wand backfired, his own memory was completely destroyed. That was his intent.
From "Harry Potter and The Chamber Of Sectets", Chapter 16 - The Chamber Of Secrets
“The adventure ends here, boys!” he said. “I shall take a bit of this skin back up to the school, tell them I was too late to save the girl, and that you two tragically lost your minds at the sight of her mangled body — say good-bye to your memories!”
He raised Ron’s Spellotaped wand high over his head and yelled, “Obliviate!”
The intent of a Wizard obliviating a Muggle is to remove a memory of an event the Muggle should not remember (eg. being witness to some magic). This is precisely what the magic does.
However, a malicious Muggle-hating wizard may wish to delete more, and cause damage. Again, it is the Wizard's intention that matters.