A shadow is something insubstantial but nevertheless 'there'. As a result, it has meant a tiny portion or trace since the 1500s. If something is 'without a shadow of doubt', it means it is absolutely certain and there is no way in which it can be queried or denied.