As for Bears and other wild animals. They don't want people, just their food. This is the only reason they come around. Animals have a great sense of smell and if something smells good their first instinct is food.
People don't seem to know or care that feeding them and/or not securing their food properly making it easy for them to get to it, only domesticates them. Making them dependent on humans. When this happens to any animal, they can become less afraid and even more aggressive.
When it is determind that an animal has become aggressive it will usually be relocated. Eventually, some do find their way back. If the animal is found to be a danger, due to his new found dependency on humans, it will be destroyed.
We usually clean up camp after every meal. Nothing of any fragrence ( toothpaste, perfume, mouthwash, soap, candy, food, etc.) is allowed in the tents.
We have had a few Bear encounters in past camping trips. Second time a couple of years later.
There are other aggressive things out there, Snakes and insects for example. Take some time to learn about your wilderness hosts, I mean you are in their home.
For the most part you are safe. Still you should always keep in mind that they are there. Listen to what the Rangers have to say and read the literature they give you or that you optain. Follow their guidelines and you will be fine.
Visit the Yosemite Web page and read about What to do during an encounter.