South Korea's President Yoon Suk Yeol prompted a night of fear and confusion by issuing a sudden declaration of martial law before lifting it in the early hours.