Green’s Dictionary of Slang

take the cake v.

also embezzle the pastry, take the bakehouse, ...baker’s shop, ...the bakery, ...the beer, ...the bun, …the candied-peel, ...the candle, ...the duff, ...the flour, ...the gingerbread, ...the pastry, …the peach, ...the scone, capture the cake, …the crumb, cop the cake, ...the currant
[the perceived ‘tastiness’ of the cake]

1. [mid-19C+] to surpass, to outdo, esp. in excessive or extreme behaviour or of a near-intolerable situation or happening; ad hoc vars. abound.

2. [1960s+] to be highly improbable.