There has been some speculation from Koreans about what Yoon thought he was doing, though speculation is all it is.
The left-ish South Korean newsmagazine Hankyoreh ran this cartoon:Speculation is fun, but I doubt we'll ever know why Yoon made this power grab. His own political party, which voted to reject the order for martial law, has announced that they will not vote to impeach him, and he has his supporters among the populace - as I've said, there's a sizable base for authoritarianism in South Korea. The country's largest labor union has called a general strike in support of Yoon's removal, and the South Korean police are investigating whether he can be charged with insurrection.
The best thing I've seen has been this long article by Tim Shorrock, an American journalist who knows Korea and its history well. This is why I've relied heavily on independent and usually left-wing sources for news since the late 1960s: they're much more accurate than the mainstream, let alone overtly right-wing media. I remembered former ROK president Park Geun-hye's failed attempt to impose martial law to avoid impeachment in 2017, but now I learned that "Yoon's gambit began at 11:00 pm on Monday night, when Army Chief of Staff General Park An-su, a four-star general, issued a decree of martial law" - that was an hour before Yoon went before the cameras to justify his move.
I also learned more about Yoon's collaboration with US President Biden in military alliance with a re-arming Japan. (Of course Biden likes to have a toady like Yoon in an important client state.) Far from the "stability" the US prattles about, these moves destabilize northeast Asia. So it's not surprising that the US Embassy in Seoul did not condemn Yoon's attempted coup, posting that his "announcement to end martial law is a crucial step" - as though martial law just appeared of its own volition and Yoon boldly moved to end it. (Was it a coup, given that it was bloodless and failed almost immediately? Yes. Arnaud Bertrand is wrong to call it a "self-coup," since most coups are internal.) Shorrock's article is long, but it's packed with information you need.
We're living in interesting times, aren't we?