cotton on

中上級 (B2) informal

To slowly figure out what is going on.

"It took me a few minutes, but I finally cottoned on that he was joking."