If you are "detected" stealing something, but you are behind your target and sneaking, even though you fail the steal, sometimes they will not see you and you will not go into combat. You can then try to steal again, or sneak out of the area. If you exit sneak anywhere around them after failing...