There is a simplified explanation of the mechanism here [1], from which the following is taken:
> Simplified, cum-ex trading works something like this:
> Party One [..] "lends" its stock to Party Two, a bank. Under the agreement, the title and ownership of the stock is temporarily transferred to the borrower in return for a fee. [..]
> Party Two then sells the shares with-dividend to Party Three fractionally before the Record Date [i.e. dividend soon-to-be-payed]. However, the shares are delivered without-dividend just after.
> Like a magic trick, the shares "disappear" fractionally before the Record Date and "reappear" with a new owner just after. The aim is to obscure exactly who – Party One, Two or Three – owns the stock on the Record Date. As a result, two parties can simultaneously claim ownership of the one stock.
> Up until 2011, a loophole in the German tax code allowed both Party One and Party Three [..] to claim a tax reimbursement. All colluding parties would then split the gains.
[1] https://theconversation.com/the-robbery-of-the-century-the-c...
interesting, a very special case of double-spending attack, but on a security? was this kind of thing much more commonplace before electronic trading systems came about