Lots of good advice on keeping a clean camp.
I have been an avid hiker, camper, ds adventurer and spent MANY nights in bear country out in a solo camp and in camp grounds.
I have had a couple of bear encounters but no serious issues.
1 event was when we were young and dumb camping in the Sierra Nat forest west slope and we had all been drinking and having a great time. We hit the sack and after a bit we all heard some rustling, my buddy jumps up, pulls his .44 Mag and jumps out of his tent to see Yogi sitting at the camp table eating the Oreos we stupidly left out. My buddy was 10' away and the bear turns just as surprised to see him with DUHHH RUT ROH look on his face and white stuffing all over his face.
My pal was all set to shoot him but just said "ahh we caused it and he is not hurting anyone. We backed away a safe distance and gave hime some room, made some noise and he went away. We cleaned up, moved everything to a safer spot and went back to bed....a bit wary, but ended up sleeping some.
The 2nd was a bit closer and scaryer. We were in the Los Padres NF behind Gorman OHV park in the Grapevine area of So Cal. We had a group of about 10 that did the 7 mile loop up and around the top of the mountain and were coming down. Me and a buddy were riding sweep, it was SOOO beautiful that day so we killed the MX bikes motors and were just quietly coasting down the fire road at about 30 mph with no noise but the buzz of the chain thru the guides.
We round a corner with my buddy in front about 60' of me and a smallish black bear runs right accros the road in front of him. It was like he hid as the powered group went by and thought it was clear then just went accross the road....scared the snot out of my buddy...until he looked back and saw BIG Mamma bear run right between him and I....she did not seem happy to be separated from her cub by us....I was locked on my knobbys and cutting left...kickking the bike over as fast as I could...revving out the motor as soon as it fired and we HIGH TAILED it outta there and caught up to our group...safety in numbers I guess.
The scariest time I had turned NOT to be a bear although I was SURE it was at the time. We were in Kennedy meadows in the Fish Creek camground overflow area. I had a truck back cab over camper on my truck but I let a friend, his wife and young daughter sleep in it since they needed more than I. Slept completely out doors near the lulling fire right on the ground in my sleeping bag. It was beautiful out under the stars.
After a bit I heard what sounded like a big bear crunching something near me..I rustled around noisily finding my flashlight and flipped it on only to see NOTHING. I looked all over and nothing, no sign. Back to bed..within a minute or 2, same noise...bear crunching....again after a bit of rustling out of my bag...nothing...what? That bear is FAST.
It will not get me again...I with my bag unzipped and my flash light pointing RIGHT where I hear the noise and my thumb on the switch....2 minutes later...CRUNCH CRUNCH CRUNCH...flip on the light only to see a small field mouse or chipmunk something about 2 feet from my head munching on a couple of Dorito chips a kid had left near the fire...the terror look on that poor little guys face as I lit him up and my surprise that it was not a bear, not even a racoon, but a 3" tall rodent...I laughed my butt off, cleaned up a bit and went to sleep...soundly.
CLEAN camp is the point of 2 of my stories, a bit of noise is the point of my other story.
You have WAAAAYYY more chance of hitting a deer, an Elk, a Moose....or a stupid car pulling out in front of you or a dumb texter crossing into your lane on your bike than ANY chance of a bear...
If you look at those stats on Wiki there that were posted, of 38 attacks in the lower 48, 16 of them were from captive bears and idiot owners or caretakers. Only 22 fatalities in 110 years from wild bears and many of those were in cabins or outside of cabins walking dogs and things like that. Not too many were people in tents...a few, but only a few over 110 years.
Pretty good odds. MILLIONS of Nat Park and NF visitors every year in major bear country and still only a few deaths. Ride smart, camp smart and clean and sleep well. Get some bear spray if you think that will calm your fears some, but remember firing that off inside a tent that a bear is rustling around will likely ruin your night ALOT more than the bears...