I've never been "caught" in a way that had any bad consequence, I'll say that upfront. But people have stumbled into me. I'll try to recount all the times it's happened:
-One morning in Oceanside, CA I was having a really pleasant sleep (that end of morning sleep when you're about to wake up and borderline conscious, close enough to conscious that you can practically appreciate how awesome sleep and dreaming is while you do it) and I heard a dog barking. First I incorporated it into my dream and then I realized it was really happening. His master yelled at him, very sternly, "Livan!", "Livan! Come get cookie!" And after a few rounds of that, Livan finally trotted off.
There was probably a quick moment of "oh shit, a dog", but pretty much at the same time it was clear the guy was calling for him (so if I got mauled it would only be brief), so it was more "oh shit, I'm discovered". Obviously he must have seen me (he had to be curious what the dog was barking at), but he left me alone. This was the first time I was caught (pseudo-caught, whatever you want to call it), and it was nice to see that the universe doesn't explode.
-A coyote stumbled into my camp in a nature preserve area in San Diego, in the morning. I'd frequently hear squirrels and chipmunks and stuff running around, the coyote's footsteps barely made me look. It seemed a little out of line but not majorly, it was probably just a loud squirrel. And then there was a poignant little shock when I made eye contact with a coyote. He was more startled than I was though and quickly scurried off. (I had read a day or so earlier about how coyotes are usually intensely afraid of humans. So I had confident mojo and he knew it.)
-A homeless guy stumbled into me in the same nature preserve area. (I'm homeless, but I mean, he was stereotypically homeless.. his silhouette was even stereotypically homeless looking.) I heard loud noises on the hill leading down to where I was. First I worried that it was a large animal, then the noises seemed clumsy and human, and then I worried it was a park ranger who'd tell me I couldn't sleep there or something, and then it turned out it was just this guy.
He was planning on cutting up these rubber wire things that were stuck in the ground near where I was sleeping, but after 20 minutes of making noise he decided he'd let me sleep and come back in the morning. Nice guy.
-Riding my bike through California, on my way from Bakersfield to Wasco, I got a flat tire. Typically when I bike travel I plan it out (looking at Google earth) so that I figure to be somewhere with suitable camping options when it starts to get dark. Really most anywhere is suitable, but this was farm country. (That's the worst. Open desert is great, even small and medium cities are fine. But farm country land is all wide open and actively claimed, there's no way to feel comfortable laying down in between rows of crops.)
I walked like 4-5 miles and finally found a field that I felt OK with. In the morning a Mexican guy came by in a truck and asked something like "You sleep good there last night? jaja." Then he made sure I was planning on picking up all my stuff, and he didn't really have a problem with me.
-In the hills outside of Las Vegas, at about 2am, I heard a lunatic stumbling around. This is a spot I camped in frequently, and there was one other time I heard someone in the same area (from 100 yards or so higher than me on the hills), and he ended up just camping there like I was. So initially I assumed this was him again and I wasn't too worried. I almost just went back to sleep and thought nothing of it.
Then I heard him talking, angrily, saying weird things about how he couldn't believe his own sister was "plotting on him" (or something like that). He was viciously angry. My feeling was he was on the phone, but it's also possible he was a lunatic talking to himself. (The first possibility is actually scarier -- I don't want to be caught overhearing a phone conversation about some sort of messed up shit.)
It's a cumbersome little hike down from where he is, especially if he's not familiar with it, so it plays as if he's a decent distance away from me even though he's right there. I have my bike with me, which is a liability in the sense that I have to carry it for some distance before I make it down to the bike path, but of course then once I get to the bike path I'm home free. If I didn't have the bike I probably would have quietly slipped away as soon as I heard him talking. Instead I slid my shoes on and stayed alert, ready to run if he got close to me.
Eventually he seems to be looking at me. I don't know if he could tell for sure I was there (I could see him, so I guess he probably could see me), but he definitely seemed to be looking curiously in my direction. Rather than take any chances, I slung my backpack on and picked up my bike and booked it for the path (probably 100 yards or so down below where I was). I'm sure he didn't even run after me (it had to be obvious that I'd make it to the bike path before he caught up to me, if he was even dangerous), but it was a real adrenaline rush anyways. I left behind most of my clothes and my air mattress and sleeping bag (it was all still there when I checked for it a few days later).
All that said, if you want to stealth camp in a way that makes you really unlikely to be discovered, you can do that. There are different philosophies on how you camp. The more off the beaten path you are, the less likely you'll be discovered. But then (in the unlikely double-coincidence of someone stumbling into you and so happening to be someone who wants to harm you), you have less recourse. (You have less people around you to deter crime and possibly help you.) So it's more likely you'll be seen, but being seen is generally less dangerous.
Personally, I tend to err closer to civilization. Sometimes if I'm bike
touring, I'll sleep a stone's throw away from a busy road or highway (tucked behind bushes or something). It isn't ideal, but it's at least better than being in the same general area but further away from traffic. So it's a good fallback when nothing else is calling to me and I don't necessarily trust the area.
One of my favorite stealth camping spots I found was in Wasco, CA. Behind McDonald's (which is open all night for drive-thru, I believe) and right next to a 24-hour gas station. There's a field with those desert bush things, so between the cover of darkness and the bushes, I was well hidden. Yet at the same time I had the protection of mainstream corporate suburbia. And the area wasn't marked with no trespassing signs or anything like that, so it seemed to basically possess none of the 3 general risks (wildlife, people, legal). I stayed in Wasco for over a week, mostly just cause I liked camping there so much.
When I stealth camp a more permanent location, I don't like to spend a big chunk of my day traveling to and from camp. Even a little chunk adds up over time. I'm the rare breed of vagabond who likes to be online a lot. So I tend to look for little nooks and crannies closer to civilization. But you can gravitate more towards the boonies or go deeper into parks and city forests if you want to scale down the chance of being seen.