Complex sentence: The divine designation is a logical necessity because Imam must be infallible and as it is a hidden virtue, only Allah knows who is infallible and this designation is only expressed to the people by an infallible: the previous Prophet or Imam.
Split into simpler sentences: The divine designation is a logical necessity because Imam must be infallible and as this is a hidden virtue, known only to Allah. Thus this designation is expressed to the people only by an infallible: the previous Prophet or Imam.