A black bear that attacks (rare) is much more aggressive than a grizzly. A grizzly will usually stop the attack once the threat is gone - hence one is supposed to cover up and play dead.
While black bear attacks are rare, when they do attack they won’t stop until you are eaten. So yes, you fight back and hopefully can make it too much trouble for a meal. For cougars one is supposed to fight them back as well.
Canoe trips in Northern Minnesota we would stash the food under overturned metal canoes. The black bears would make enough noise trying to get to it and we would wake up and could chase them off with pots and pans. Then 10 minutes later hear them at the next campsite down the shoreline a half-mile and hear THEM bang their pots and pans. Those bears were just making their nightly rounds!
One of the states with the largest black bear populations is also one of the states most densely populated by humans...New Jersey!