Markets went from record highs to red in a matter of hours. Here's what flipped the script on Thursday.