When a boss can't attack something most times he resets. A great example is Siegecrafter in SoO, where if you know that you are gonna wipe and everyone go on the belt the boss will reset since he can't hit anything. Hunters, mages, rogues and a few other classes can reset the boss if they're the last ones alive using abilities that make them untargetable by the boss.
If none of the targets in combat are in the battlefield the boss will despawn or walk back to his normal spot, depending on the boss. very few bosses WALK back. Either way, it ends combat, and unless you ressed on a boss that doesn't despawn, you're then safe to ress and get away.